forked from loafle/openapi-generator-original
		
	* add spotless plugin to kotlin client * add spotless plugin to kotlin client * use 6.13.0
		
			
				
	
	
		
			70 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
group 'org.openapitools'
 | 
						|
version '1.0.0'
 | 
						|
 | 
						|
wrapper {
 | 
						|
    gradleVersion = '7.5'
 | 
						|
    distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
 | 
						|
}
 | 
						|
 | 
						|
buildscript {
 | 
						|
    ext.kotlin_version = '1.8.10'
 | 
						|
    ext.spotless_version = "6.13.0"
 | 
						|
 | 
						|
    repositories {
 | 
						|
        maven { url "https://repo1.maven.org/maven2" }
 | 
						|
    }
 | 
						|
    dependencies {
 | 
						|
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
 | 
						|
        classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
 | 
						|
        classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version"
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
apply plugin: 'kotlin'
 | 
						|
apply plugin: 'kotlin-parcelize'
 | 
						|
apply plugin: 'kotlinx-serialization'
 | 
						|
apply plugin: 'maven-publish'
 | 
						|
apply plugin: 'com.diffplug.spotless'
 | 
						|
 | 
						|
repositories {
 | 
						|
    maven { url "https://repo1.maven.org/maven2" }
 | 
						|
}
 | 
						|
 | 
						|
// Use spotless plugin to automatically format code, remove unused import, etc
 | 
						|
// To apply changes directly to the file, run `gradlew spotlessApply`
 | 
						|
// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
 | 
						|
spotless {
 | 
						|
    // comment out below to run spotless as part of the `check` task
 | 
						|
    enforceCheck false
 | 
						|
 | 
						|
    format 'misc', {
 | 
						|
        // define the files (e.g. '*.gradle', '*.md') to apply `misc` to
 | 
						|
        target '.gitignore'
 | 
						|
 | 
						|
        // define the steps to apply to those files
 | 
						|
        trimTrailingWhitespace()
 | 
						|
        indentWithSpaces() // Takes an integer argument if you don't like 4
 | 
						|
        endWithNewline()
 | 
						|
    }
 | 
						|
    kotlin {
 | 
						|
        ktfmt()
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
test {
 | 
						|
    useJUnitPlatform()
 | 
						|
}
 | 
						|
 | 
						|
dependencies {
 | 
						|
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
 | 
						|
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
 | 
						|
    implementation "com.squareup.okhttp3:okhttp:4.11.0"
 | 
						|
    testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
 | 
						|
}
 | 
						|
 | 
						|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
 | 
						|
    kotlinOptions {
 | 
						|
        freeCompilerArgs += "-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi"
 | 
						|
    }
 | 
						|
}
 |