Compare commits

...

5 Commits

3 changed files with 23 additions and 6 deletions
+16 -3
View File
@@ -7,8 +7,11 @@ plugins {
// The kotlin-dsl plugin requires a repository to be declared
repositories {
maven { url = uri("https://nexus.lan.ubrr.ru/repository/gradle-central") }
maven { url = uri("https://nexus.lan.ubrr.ru/repository/maven-jcenter") }
jcenter()
google()
gradlePluginPortal()
}
dependencies {
@@ -16,18 +19,28 @@ dependencies {
implementation("com.android.tools.build:gradle:7.1.3")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.10.0")
implementation("de.aaschmid:gradle-cpd-plugin:3.1")
implementation("de.aaschmid:gradle-cpd-plugin:3.3")
// kotlin plugin, required by custom plugin
implementation(kotlin("gradle-plugin", embeddedKotlinVersion))
implementation(kotlin("gradle-plugin", "1.8.10"))
gradleKotlinDsl()
implementation(kotlin("stdlib-jdk8"))
}
//val compileJava: JavaCompile by tasks
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
//compileJava.apply {
// sourceCompatibility = JavaVersion.VERSION_17.toString()
// targetCompatibility = JavaVersion.VERSION_17.toString()
//}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}
gradlePlugin {
@@ -52,9 +52,13 @@ abstract class ApiGeneratorPlugin : Plugin<Project> {
val outputLanguage = extension.outputLanguage ?: throw IllegalStateException("Configure output language code for api generator plugin")
javaexec {
main = "-jar"
mainClass.set("-jar")
workingDir = rootDir
args = listOfNotNull(
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
"--add-opens",
"java.base/java.time=ALL-UNNAMED",
configurations.getByName("apiGenerator").asPath,
"generate-client-code",
"--output-language",
@@ -68,7 +72,7 @@ abstract class ApiGeneratorPlugin : Plugin<Project> {
"--package-name",
extension.outputPackageName,
"--recreate_output_dirs",
extension.recreateOutputDir.toString()
extension.recreateOutputDir.toString(),
)
}
}
@@ -42,7 +42,7 @@ class CpdLinter : Linter {
}
tasks.withType<Cpd> {
reports.xml.required.set(true)
reports.xml.destination = getCpdReportFile()
reports.xml.outputLocation.set(getCpdReportFile())
ignoreFailures = true
source = getSources(extension.excludes)
}