From c9aaefe996b1324218549910b5d6eb7b171753ec Mon Sep 17 00:00:00 2001 From: ssk Date: Tue, 21 Apr 2026 09:33:57 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20Gradle=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20Kotlin=20DSL=EB=A1=9C=20=EB=A7=88=EC=9D=B4=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 루트 build.gradle, settings.gradle → *.kts - example/, example/app/ 빌드 스크립트 *.kts 변환 - gradlePlugin 블록은 create("stringTablePlugin") 형태로 교체 - kotlinOptions jvmTarget=17 을 tasks.withType으로 이관 - example/app에서 androidStringTable 확장은 configure로 적용 Co-Authored-By: Claude Opus 4.7 (1M context) --- build.gradle | 54 ------------------------------- build.gradle.kts | 51 +++++++++++++++++++++++++++++ example/app/build.gradle | 60 ---------------------------------- example/app/build.gradle.kts | 62 ++++++++++++++++++++++++++++++++++++ example/build.gradle | 28 ---------------- example/build.gradle.kts | 24 ++++++++++++++ example/settings.gradle | 2 -- example/settings.gradle.kts | 2 ++ settings.gradle | 1 - settings.gradle.kts | 1 + 10 files changed, 140 insertions(+), 145 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 example/app/build.gradle create mode 100644 example/app/build.gradle.kts delete mode 100644 example/build.gradle create mode 100644 example/build.gradle.kts delete mode 100644 example/settings.gradle create mode 100644 example/settings.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 13fdf07..0000000 --- a/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -plugins { - id 'java' - id 'java-gradle-plugin' - id 'org.jetbrains.kotlin.jvm' version '1.9.0' -} - -group 'com.rsupport' -version '1.1.0' - -repositories { - mavenCentral() -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - testImplementation 'junit:junit:4.12' - testImplementation 'org.hamcrest:hamcrest-library:1.3' - testImplementation 'org.hamcrest:hamcrest-core:1.3' - api 'org.apache.poi:poi:5.4.1' - api 'commons-codec:commons-codec:1.5' - api 'org.apache.poi:poi-ooxml:5.4.1' - api 'org.apache.xmlbeans:xmlbeans:2.3.0' - api 'stax:stax-api:1.0.1' - api 'dom4j:dom4j:1.6.1' - api 'xml-apis:xml-apis:1.0.b2' - api 'org.jdom:jdom2:2.0.6.1' - implementation 'com.google.api-client:google-api-client:1.30.4' - implementation 'com.google.oauth-client:google-oauth-client-jetty:1.30.4' - implementation 'com.google.apis:google-api-services-drive:v3-rev110-1.23.0' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'com.google.apis:google-api-services-sheets:v4-rev581-1.25.0' - api(gradleApi()) - api(localGroovy()) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" -} - -gradlePlugin { - plugins { - stringTablePlugin { - id = 'android-string-table' - implementationClass = 'com.rsupport.plugin.StringTablePlugin' - } - } -} -compileKotlin { - kotlinOptions { - jvmTarget = "17" - } -} -compileTestKotlin { - kotlinOptions { - jvmTarget = "17" - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..69230b2 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,51 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + `java-gradle-plugin` + kotlin("jvm") version "1.9.0" +} + +group = "com.rsupport" +version = "1.1.0.14" + +repositories { + mavenCentral() +} + +dependencies { + testImplementation("junit:junit:4.12") + testImplementation("org.hamcrest:hamcrest-library:1.3") + testImplementation("org.hamcrest:hamcrest-core:1.3") + api("org.apache.poi:poi:5.4.1") + api("commons-codec:commons-codec:1.5") + api("org.apache.poi:poi-ooxml:5.4.1") + api("org.apache.xmlbeans:xmlbeans:2.3.0") + api("stax:stax-api:1.0.1") + api("dom4j:dom4j:1.6.1") + api("xml-apis:xml-apis:1.0.b2") + api("org.jdom:jdom2:2.0.6.1") + implementation("com.google.api-client:google-api-client:1.30.4") + implementation("com.google.oauth-client:google-oauth-client-jetty:1.30.4") + implementation("com.google.apis:google-api-services-drive:v3-rev110-1.23.0") + implementation("com.google.code.gson:gson:2.8.6") + implementation("com.google.apis:google-api-services-sheets:v4-rev581-1.25.0") + api(gradleApi()) + api(localGroovy()) + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") +} + +gradlePlugin { + plugins { + create("stringTablePlugin") { + id = "android-string-table" + implementationClass = "com.rsupport.plugin.StringTablePlugin" + } + } +} + +tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } +} diff --git a/example/app/build.gradle b/example/app/build.gradle deleted file mode 100644 index 6529ead..0000000 --- a/example/app/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' -} - -android { - compileSdkVersion 33 - buildToolsVersion "30.0.3" - - defaultConfig { - applicationId "example.app" - minSdkVersion 16 - targetSdkVersion 33 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = '17' - } -} - -dependencies { - - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.3.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - testImplementation 'junit:junit:4.+' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' -} - -apply plugin: 'android-string-table' -androidStringTable { - googleDriveCredentialPath "${project.rootDir}/app/i18n/credentials.json" - - // https://docs.google.com/spreadsheets/d/12hmQ7U0npYM4hK4ck3qN9bMUDRu-ZcPueluxz5X4w30/edit#gid=1661361434 - targetSheetUrl "https://docs.google.com/spreadsheets/d/12hmQ7U0npYM4hK4ck3qN9bMUDRu-ZcPueluxz5X4w30/edit#gid=1661361434" - outputXlsxFilePath "${project.rootDir}/app/i18n/languages.xlsx" - rowPositionColumnHeader 1 - doNotConvertNewLine false - defaultLanguageForValues "en" - - androidResourcePath "${project.rootDir}/app/src/main/res" - outputXmlFileName 'strings_generated' -} diff --git a/example/app/build.gradle.kts b/example/app/build.gradle.kts new file mode 100644 index 0000000..6dd850f --- /dev/null +++ b/example/app/build.gradle.kts @@ -0,0 +1,62 @@ +import com.rsupport.plugin.StringTableExtension + +plugins { + id("com.android.application") + id("kotlin-android") +} + +android { + compileSdk = 33 + buildToolsVersion = "30.0.3" + + defaultConfig { + applicationId = "example.app" + minSdk = 16 + targetSdk = 33 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = "17" + } +} + +dependencies { + val kotlinVersion = rootProject.extra["kotlin_version"] as String + implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion") + implementation("androidx.core:core-ktx:1.3.2") + implementation("androidx.appcompat:appcompat:1.2.0") + implementation("com.google.android.material:material:1.3.0") + implementation("androidx.constraintlayout:constraintlayout:2.0.4") + testImplementation("junit:junit:4.+") + androidTestImplementation("androidx.test.ext:junit:1.1.2") + androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0") +} + +apply(plugin = "android-string-table") +configure { + googleDriveCredentialPath.set("${project.rootDir}/app/i18n/credentials.json") + targetSheetUrl.set("https://docs.google.com/spreadsheets/d/12hmQ7U0npYM4hK4ck3qN9bMUDRu-ZcPueluxz5X4w30/edit#gid=1661361434") + outputXlsxFilePath.set("${project.rootDir}/app/i18n/languages.xlsx") + rowPositionColumnHeader.set(1) + doNotConvertNewLine.set(false) + defaultLanguageForValues.set("en") + androidResourcePath.set("${project.rootDir}/app/src/main/res") + outputXmlFileName.set("strings_generated") +} diff --git a/example/build.gradle b/example/build.gradle deleted file mode 100644 index 0ceb545..0000000 --- a/example/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - ext.kotlin_version = "1.7.10" - repositories { - google() - jcenter() - maven { url 'https://jitpack.io' } - } - dependencies { - classpath "com.android.tools.build:gradle:7.3.1" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - classpath 'com.github.rsupportrnd:android-string-table:1.1.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/example/build.gradle.kts b/example/build.gradle.kts new file mode 100644 index 0000000..fe13a26 --- /dev/null +++ b/example/build.gradle.kts @@ -0,0 +1,24 @@ +buildscript { + extra["kotlin_version"] = "1.7.10" + repositories { + google() + mavenCentral() + maven(url = "https://jitpack.io") + } + dependencies { + classpath("com.android.tools.build:gradle:7.3.1") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${extra["kotlin_version"]}") + classpath("com.github.rsupportrnd:android-string-table:1.1.0") + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/example/settings.gradle b/example/settings.gradle deleted file mode 100644 index 42536f5..0000000 --- a/example/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -include ':app' -rootProject.name = "StringTableExampleApp" \ No newline at end of file diff --git a/example/settings.gradle.kts b/example/settings.gradle.kts new file mode 100644 index 0000000..721a73e --- /dev/null +++ b/example/settings.gradle.kts @@ -0,0 +1,2 @@ +include(":app") +rootProject.name = "StringTableExampleApp" diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e5657d1..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'android-string-table' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..6ada047 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "android-string-table"