Skip to content

Commit

Permalink
Merge pull request #105 from KakaoCup/grand-build-uplift
Browse files Browse the repository at this point in the history
feat(core): gradle 8, kotlin, libs.toml
  • Loading branch information
Vacxe authored Nov 25, 2023
2 parents cf878eb + c61f4f0 commit 6882028
Show file tree
Hide file tree
Showing 24 changed files with 212 additions and 271 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/master-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
java-version: 17
- name: dokkaHtml
run: |
./gradlew clean dokkaHtml
- uses: helaili/jekyll-action@v2
- name: Build Page
uses: actions/jekyll-build-pages@v1
with:
jekyll_src: 'html'
target_branch: 'gh-pages'
token: ${{ secrets.GITHUB_TOKEN }}
source: "./html"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site

31 changes: 17 additions & 14 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ jobs:
runs-on: ubuntu-latest
name: Detekt
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
java-version: 17
- name: detekt
run: |
./gradlew clean detekt
Expand All @@ -19,15 +20,16 @@ jobs:
name: Assemble Debug APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
java-version: 17
- name: Assemble Debug APK
run: bash ./gradlew sample:assembleDebug
- name: Upload app APK
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: apk
path: sample/build/outputs/apk/debug/sample-debug.apk
Expand All @@ -37,15 +39,16 @@ jobs:
name: Assemble Instrumental APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
java-version: 17
- name: Assemble Instrumental APK
run: bash ./gradlew sample:assembleDebugAndroidTest
- name: Upload app APK
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: apk
path: sample/build/outputs/apk/androidTest/debug/sample-debug-androidTest.apk
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release-deploy-ext-clicks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
java-version: 17
- uses: little-core-labs/[email protected]
- name: deploy-release-ext-clicks
run: ./gradlew :kakao-ext-clicks:publishDefaultPublicationToOSSHRRepository -PreleaseMode=RELEASE --stacktrace
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
java-version: 17
- uses: little-core-labs/[email protected]
- name: deploy-release
run: ./gradlew :kakao:publishDefaultPublicationToOSSHRRepository -PreleaseMode=RELEASE --stacktrace
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.2")
classpath(libs.com.android.tools.build.gradle)
}
}

Expand All @@ -15,11 +15,11 @@ repositories {
}

plugins {
id("io.gitlab.arturbosch.detekt") version Versions.detekt
id("io.gitlab.arturbosch.detekt") version libs.versions.detekt
}

detekt {
toolVersion = "1.17.1"
toolVersion = libs.versions.detekt.get()
input = files(subprojects.map {
File(it.projectDir, "/src/main/kotlin")
})
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21")
implementation("com.android.tools.build:gradle:7.3.1")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20")
implementation("org.kohsuke:github-api:1.129")
implementation(libs.org.jetbrains.kotlin.kotlinGradlePlugin )
implementation(libs.com.android.tools.build.gradle)
implementation(libs.org.jetbrains.dokka.dokkaGradlePlugin)
implementation(libs.org.kohsuke.githubApi)
}
7 changes: 7 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencyResolutionManagement {
versionCatalogs {
register("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
47 changes: 3 additions & 44 deletions buildSrc/src/main/kotlin/KakaoDeployment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,53 +58,12 @@ object KakaoDeployment {

project.plugins.apply("maven-publish")

val (component, additionalArtifacts) = when {
project.extensions.findByType(LibraryExtension::class) != null -> {
val android = project.extensions.findByType(LibraryExtension::class)!!
val main = android.sourceSets.getByName("main")
val sourcesJar by project.tasks.creating(Jar::class) {
classifier = "sources"
from(main.java.srcDirs)
}
val javadocJar by project.tasks.creating(Jar::class) {
classifier = "javadoc"
val dokka = project.tasks.findByName("dokkaJavadoc") as DokkaTask
from(dokka.outputDirectory)
dependsOn(dokka)
}

Pair(project.components["release"], listOf(sourcesJar, javadocJar))
}

project.the(JavaPluginConvention::class) != null -> {
val javaPlugin = project.the(JavaPluginConvention::class)

val sourcesJar by project.tasks.creating(Jar::class) {
classifier = "sources"
from(javaPlugin.sourceSets["main"].allSource)
}
val javadocJar by project.tasks.creating(Jar::class) {
classifier = "javadoc"
from(javaPlugin.docsDir)
dependsOn("javadoc")
}

Pair(project.components["java"], listOf(sourcesJar, javadocJar))
}

else -> {
throw RuntimeException("Unknown plugin")
}
}

project.configure<PublishingExtension> {
publications {
create("default", MavenPublication::class.java) {
KakaoDeployment.customizePom(pom)
additionalArtifacts.forEach { it ->
artifact(it)
}
from(component)
groupId = PackageInfo.groupId
customizePom(pom)
from(project.components["release"])
}
}
repositories {
Expand Down
34 changes: 4 additions & 30 deletions buildSrc/src/main/kotlin/KakaoExtClicksDeployment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,41 +58,15 @@ object KakaoExtClicksDeployment {

project.plugins.apply("maven-publish")

val (component, additionalArtifacts) = when {
project.extensions.findByType(LibraryExtension::class) != null -> {
val android = project.extensions.findByType(LibraryExtension::class)!!
val main = android.sourceSets.getByName("main")
val sourcesJar by project.tasks.creating(Jar::class) {
classifier = "sources"
from(main.java.srcDirs)
}

Pair(project.components["release"], listOf(sourcesJar))
}
project.the(JavaPluginConvention::class) != null -> {
val javaPlugin = project.the(JavaPluginConvention::class)

val sourcesJar by project.tasks.creating(Jar::class) {
classifier = "sources"
from(javaPlugin.sourceSets["main"].allSource)
}
Pair(project.components["java"], listOf(sourcesJar))
}
else -> {
throw RuntimeException("Unknown plugin")
}
}

project.configure<PublishingExtension> {
publications {
create("default", MavenPublication::class.java) {
KakaoExtClicksDeployment.customizePom(pom)
additionalArtifacts.forEach { it ->
artifact(it)
}
from(component)
groupId = PackageInfo.groupId
customizePom(pom)
from(project.components["release"])
}
}

repositories {
maven {
name = "Local"
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/PackageInfo.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import java.io.File

object PackageInfo {
const val groupId = "io.github.kakaocup"
}
49 changes: 0 additions & 49 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,6 @@ import java.io.File
object Versions {
val kakaoVersion = File("buildsystem/version").readText().trim()
val kakaoExtClicksVersion = File("buildsystem/extclickversion").readText().trim()

val kotlin = "1.7.21"
val detekt = "1.17.1"
val dokka = "1.7.20"
val maven = "1.5"
val oss = "4.5.4"
val appcompat = "1.3.0"
val recyclerview = "1.2.0"
val viewpager2 = "1.0.0"
val swiperefresh = "1.1.0"
val annotation = "1.2.0"
val design = "1.3.0"
val espresso = "3.5.1"
val espresso_rules = "1.4.0"
val espresso_runner = "1.4.0"
val junit = "4.13.2"
val junit_ext = "1.1.2"
val gradle_versions = "0.39.0"
val google_maps = "17.0.1"
val google_maps_utils = "2.3.0"
val multidex = "2.0.1"
}

object Libraries {
val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
val kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
val detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${Versions.detekt}"
val dokka = "org.jetbrains.dokka:kotlin-as-java-plugin:${Versions.dokka}"
val dokka_gradle = "org.jetbrains.dokka:dokka-gradle-plugin:${Versions.dokka}"
val maven = "com.github.dcendents:android-maven-gradle-plugin:${Versions.maven}"
val oss = "org.jfrog.buildinfo:build-info-extractor-gradle:${Versions.oss}"
val appcompat = "androidx.appcompat:appcompat:${Versions.appcompat}"
val googleMaps = "com.google.android.gms:play-services-maps:${Versions.google_maps}"
val googleMapsUtils = "com.google.maps.android:maps-utils-ktx:${Versions.google_maps_utils}"
val recyclerview = "androidx.recyclerview:recyclerview:${Versions.recyclerview}"
val viewpager2 = "androidx.viewpager2:viewpager2:${Versions.viewpager2}"
val swiperefresh = "androidx.swiperefreshlayout:swiperefreshlayout:${Versions.swiperefresh}"
val annotation = "androidx.annotation:annotation:${Versions.annotation}"
val design = "com.google.android.material:material:${Versions.design}"
val espresso_runner = "androidx.test:runner:${Versions.espresso_runner}"
val espresso_rules = "androidx.test:rules:${Versions.espresso_rules}"
val espresso_core = "androidx.test.espresso:espresso-core:${Versions.espresso}"
val espresso_web = "androidx.test.espresso:espresso-web:${Versions.espresso}"
val espresso_contrib = "androidx.test.espresso:espresso-contrib:${Versions.espresso}"
val espresso_intents = "androidx.test.espresso:espresso-intents:${Versions.espresso}"
val junit = "junit:junit:${Versions.junit}"
val junit_ext = "androidx.test.ext:junit:${Versions.junit_ext}"
val gradle_versions = "com.github.ben-manes:gradle-versions-plugin:${Versions.gradle_versions}"
val multidex = "androidx.multidex:multidex:${Versions.multidex}"
}

object Description {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError
59 changes: 59 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[versions]
jvmVersion = "17"

targetSdk = "34"
compileSdk = "34"
minSdk = "14"

agpVersion = "8.1.4"
kotlinVersion = "1.9.20"

dokkaVersion = "1.9.10"
appcompatVersion = "1.6.1"
recyclerviewVersion = "1.3.2"
viewPager2Version = "1.0.0"
swiperefreshlayoutVersion = "1.1.0"
annotationVersion = "1.2.0"
testRunnerVersion = "1.5.2"
testRulesVersion = "1.5.0"

espressoVersion = "3.5.1"

junitVersion = "4.13.2"
junitExtVersion = "1.1.5"
multidexVersion = "2.0.1"
materialVersion = "1.10.0"

detekt = "1.17.1"

githubApiVersion = "1.129"

[libraries]
com-android-tools-build-gradle = { group = "com.android.tools.build", name = "gradle", version.ref = "agpVersion" }
org-jetbrains-kotlin-kotlinGradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlinVersion" }

com-google-android-material = { group = "com.google.android.material", name = "material", version.ref = "materialVersion" }

androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompatVersion" }
androidx-recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerviewVersion" }
androidx-viewpager2 = { group = "androidx.viewpager2", name = "viewpager2", version.ref = "viewPager2Version" }
androidx-swiperefreshlayout = { group = "androidx.swiperefreshlayout", name = "swiperefreshlayout", version.ref = "swiperefreshlayoutVersion" }

androidx-test-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoVersion" }
androidx-test-espresso-web = { group = "androidx.test.espresso", name = "espresso-web", version.ref = "espressoVersion" }
androidx-test-espresso-intents = { group = "androidx.test.espresso", name = "espresso-intents", version.ref = "espressoVersion" }
androidx-test-espresso-contrib = { group = "androidx.test.espresso", name = "espresso-contrib", version.ref = "espressoVersion" }

androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "annotationVersion" }
androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "testRunnerVersion" }
androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "testRulesVersion" }

junit-junit = { group = "junit", name = "junit", version.ref = "junitVersion" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitExtVersion" }

androidx-multidex-multidex = { group = "androidx.multidex", name = "multidex", version.ref = "multidexVersion" }

org-jetbrains-dokka-kotlinAsJavaPlugin = { group = "org.jetbrains.dokka", name = "kotlin-as-java-plugin", version.ref = "dokkaVersion" }
org-jetbrains-dokka-dokkaGradlePlugin = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin", version.ref = "dokkaVersion" }

org-kohsuke-githubApi = { group = "org.kohsuke", name = "github-api", version.ref = "githubApiVersion" }
Loading

0 comments on commit 6882028

Please sign in to comment.