Skip to content

Commit 12bea4c

Browse files
committed
Upgraded to AGP 9.0.0
1 parent a32b9ae commit 12bea4c

13 files changed

Lines changed: 212 additions & 113 deletions

File tree

.github/workflows/android.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Android CI - Extensions Module
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
build-extensions:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up JDK
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: temurin
20+
java-version: 17
21+
22+
- name: Cache Gradle
23+
uses: actions/cache@v4
24+
with:
25+
path: |
26+
~/.gradle/caches
27+
~/.gradle/wrapper
28+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
29+
restore-keys: |
30+
${{ runner.os }}-gradle-
31+
32+
- name: Set up Android SDK
33+
uses: android-actions/setup-android@v3
34+
35+
- name: Grant execute permission for Gradlew
36+
run: chmod +x gradlew
37+
38+
- name: Build Debug for Extensions Module
39+
run: ./gradlew :composeextensions:assembleDebug
40+
41+
- name: Run Unit Tests for Extensions Module
42+
run: ./gradlew :composeextensions:testDebugUnitTest
43+
44+
- name: Run Lint for Extensions Module
45+
run: ./gradlew :composeextensions:lint
46+
47+
# Optional: Assemble Release for Extensions Module
48+
- name: Assemble Release
49+
run: ./gradlew :composeextensions:assembleRelease
50+
51+
# Optional: Publish artifacts
52+
# - name: Publish to Maven Local
53+
# run: ./gradlew :extensions:publishReleasePublicationToMavenLocal
54+
55+
# Optional: Upload build artifacts
56+
# - name: Upload APK
57+
# uses: actions/upload-artifact@v4
58+
# with:
59+
# name: extensions-release
60+
# path: extensions/build/outputs/aar/*.aar

.github/workflows/publish-docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Dokka Docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ '*' ]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-and-publish:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up JDK
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: temurin
24+
java-version: 17
25+
26+
- name: Grant execute permission for Gradlew
27+
run: chmod +x gradlew
28+
29+
- name: Build Dokka HTML
30+
run: ./gradlew :composeextensions:dokkaGenerateHtml
31+
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: composeextensions/build/dokka/html
37+
publish_branch: gh-pages
38+
force_orphan: true

.idea/appInsightsSettings.xml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Kotlin Extensions
22

33
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4-
[![Kotlin](https://img.shields.io/badge/Kotlin-2.2.10-blue.svg)](https://kotlinlang.org/)
5-
[![Compose](https://img.shields.io/badge/ComposeBom-2025.08.00-blue.svg)](https://developer.android.com/jetpack/compose)
4+
[![Kotlin](https://img.shields.io/badge/Kotlin-2.3.0-blue.svg)](https://kotlinlang.org/)
5+
[![Compose](https://img.shields.io/badge/ComposeBom-2026.01.00-blue.svg)](https://developer.android.com/jetpack/compose)
66
[![API](https://img.shields.io/badge/API-27%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=26)
77

88
[![Build Status](https://github.com/forteanjo/Compose_Extensions_Library/actions/workflows/android.yml/badge.svg)](https://github.com/forteanjo/Compose_Extensions_Library/actions/workflows/android.yml)

app/build.gradle.kts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22

33
plugins {
44
alias(libs.plugins.android.application)
5-
alias(libs.plugins.kotlin.android)
65
alias(libs.plugins.kotlin.compose)
6+
alias(libs.plugins.jetbrains.dokka)
7+
8+
id("maven-publish")
79
}
810

911
android {
@@ -21,16 +23,6 @@ android {
2123
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2224
}
2325

24-
buildTypes {
25-
release {
26-
isMinifyEnabled = false
27-
proguardFiles(
28-
getDefaultProguardFile("proguard-android-optimize.txt"),
29-
"proguard-rules.pro"
30-
)
31-
}
32-
}
33-
3426
compileOptions {
3527
sourceCompatibility = JavaVersion.toVersion(libs.versions.jvmTarget.get())
3628
targetCompatibility = JavaVersion.toVersion(libs.versions.jvmTarget.get())
@@ -39,7 +31,6 @@ android {
3931
kotlin {
4032
compilerOptions {
4133
freeCompilerArgs.addAll("-Xcontext-sensitive-resolution")
42-
jvmTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())
4334
}
4435
}
4536

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
plugins {
33
alias(libs.plugins.android.application) apply false
44
alias(libs.plugins.android.library) apply false
5-
alias(libs.plugins.kotlin.android) apply false
5+
alias(libs.plugins.jetbrains.dokka) apply false
66
alias(libs.plugins.kotlin.compose) apply false
77
alias(libs.plugins.kotlin.serialization) apply false
88
}

composeextensions/build.gradle.kts

Lines changed: 57 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2-
31
plugins {
42
alias(libs.plugins.android.library)
5-
alias(libs.plugins.kotlin.android)
63
alias(libs.plugins.kotlin.compose)
74
alias(libs.plugins.kotlin.serialization)
5+
alias(libs.plugins.jetbrains.dokka)
86

97
id("maven-publish")
108

@@ -26,7 +24,6 @@ android {
2624
kotlin {
2725
compilerOptions {
2826
freeCompilerArgs.addAll("-Xcontext-sensitive-resolution")
29-
jvmTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())
3027
}
3128
}
3229

@@ -38,26 +35,6 @@ android {
3835
dataBinding = false
3936
}
4037

41-
sourceSets["main"].java {
42-
srcDirs(
43-
"src/main/kotlin",
44-
"src/common/kotlin",
45-
"src/debug/kotlin",
46-
"src/release/kotlin",
47-
"src/staging/kotlin",
48-
"src/preproduction/kotlin"
49-
)
50-
}
51-
52-
// Add this to your android block to generate Javadoc from Kotlin sources
53-
// (if you are using Dokka, the setup is different)
54-
// For basic Javadoc with KDoc:
55-
tasks.withType<Javadoc> {
56-
source(android.sourceSets["main"].java.srcDirs)
57-
classpath += project.files(android.bootClasspath.joinToString(File.pathSeparator))
58-
// Exclude generated files if necessary
59-
exclude("**/R.class", "**/BuildConfig.class")
60-
}
6138

6239
publishing {
6340
singleVariant("release") {
@@ -83,80 +60,70 @@ dependencies {
8360
implementation(libs.kotlin.extensions.library)
8461
}
8562

86-
afterEvaluate {
87-
publishing {
88-
publications {
89-
// Configure the "release" publication that AGP's `singleVariant("release")` creates.
90-
// The name of the publication created by AGP for singleVariant("release")
91-
// is conventionally the name of the variant itself, so "release".
92-
// However, it's safer to configure all MavenPublications of type MavenPublication if you only have one.
93-
// Or, if you know the name is 'release' (which it should be for singleVariant("release")).
94-
95-
// Option A: Configure the specific publication if you are sure of its name
96-
// (AGP creates one named after the variant, so "release" in this case)
97-
// AGP creates a publication named after the variant, so "release" in this case.
98-
create<MavenPublication>("release") {
99-
// The `from(components["release"])` is often handled automatically by singleVariant,
100-
// but explicitly adding it inside afterEvaluate can sometimes help ensure timing.
101-
// If you still have issues, you can try re-adding it here.
102-
from(components["release"]) // Already handled by singleVariant("release") usually
103-
104-
105-
groupId = "com.github.forteanjo"
106-
artifactId = "compose-extensions"
107-
version = "1.0.0"
108-
109-
// Add these for sources and Javadoc
110-
// artifact(tasks.named("sourcesJar")) // Assumes you have a sourcesJar task (see below)
111-
// artifact(tasks.named("javadocJar")) // Assumes you have a javadocJar task (see below)
112-
113-
pom {
114-
name.set(project.name) // Or a custom name
115-
description.set("Useful Jetpack compose extensions for Android development.") // Example description
116-
url.set("https://github.com/Forteanjo/Compose_Extensions_Library") // Example URL
117-
118-
licenses {
119-
license {
120-
name.set("The MIT License") // Or your chosen license
121-
url.set("http://opensource.org/licenses/MIT")
122-
}
123-
}
63+
// Creates a JAR file from the output of the dokkaHtml task.
64+
// This is used to publish the documentation along with the library.
65+
tasks.register<Jar>("javadocJar") {
66+
dependsOn(tasks.named("dokkaHtml"))
67+
from(tasks.named<org.jetbrains.dokka.gradle.DokkaTask>("dokkaHtml").flatMap { it.outputDirectory })
68+
archiveClassifier.set("javadoc")
69+
}
70+
71+
publishing {
72+
publications {
73+
// Configure the "release" publication that AGP's `singleVariant("release")` creates.
74+
// The name of the publication created by AGP for singleVariant("release")
75+
// is conventionally the name of the variant itself, so "release".
76+
// However, it's safer to configure all MavenPublications of type MavenPublication if you only have one.
77+
// Or, if you know the name is 'release' (which it should be for singleVariant("release")).
78+
79+
// Option A: Configure the specific publication if you are sure of its name
80+
// (AGP creates one named after the variant, so "release" in this case)
81+
// AGP creates a publication named after the variant, so "release" in this case.
82+
create<MavenPublication>("release") {
83+
groupId = "com.github.forteanjo"
84+
artifactId = "compose-extensions"
85+
version = "1.0.1"
86+
87+
afterEvaluate {
88+
from(components["release"])
89+
}
12490

125-
developers {
126-
developer {
127-
id.set("forteanjo")
128-
name.set("Donald McCaskey")
129-
email.set("forteanjo@sky.com")
130-
}
91+
// Include the JAR generated by the javadocJar task in the publication.
92+
artifact(tasks.named("javadocJar"))
93+
94+
pom {
95+
name.set(project.name) // Or a custom name
96+
description.set("Useful Jetpack compose extensions for Android development.") // Example description
97+
url.set("https://github.com/Forteanjo/Compose_Extensions_Library") // Example URL
98+
99+
licenses {
100+
license {
101+
name.set("The MIT License") // Or your chosen license
102+
url.set("http://opensource.org/licenses/MIT")
131103
}
104+
}
132105

133-
scm {
134-
connection.set("scm:git:git://github.com/forteanjo/Compose_Extensions_Library.git")
135-
developerConnection.set("scm:git:ssh://github.com/forteanjo/Compose_Extensions_Library.git")
136-
url.set("https://github.com/forteanjo/Compose_Extensions_Library/tree/main")
106+
developers {
107+
developer {
108+
id.set("forteanjo")
109+
name.set("Donald McCaskey")
110+
email.set("forteanjo@sky.com")
137111
}
138112
}
139-
}
140113

141-
// Option B (Safer if you're unsure of the exact auto-generated publication name,
142-
// but assumes you only have ONE publication being created by android.publishing):
143-
// withType<MavenPublication>().configureEach {
144-
// // This will apply to ANY MavenPublication. Be careful if you have others.
145-
// if (name == "release") { // Double-check the name if using this more general approach
146-
// groupId = "com.github.forteanjo"
147-
// artifactId = "extensions"
148-
// version = "1.0.0"
149-
//
150-
// pom { /* ... as above ... */ }
151-
// }
152-
// }
114+
scm {
115+
connection.set("scm:git:git://github.com/forteanjo/Compose_Extensions_Library.git")
116+
developerConnection.set("scm:git:ssh://github.com/forteanjo/Compose_Extensions_Library.git")
117+
url.set("https://github.com/forteanjo/Compose_Extensions_Library/tree/main")
118+
}
119+
}
153120
}
121+
}
154122

155-
repositories {
156-
maven {
157-
name = "localRelease"
158-
url = uri("${layout.buildDirectory}/repo")
159-
}
123+
repositories {
124+
maven {
125+
name = "localRelease"
126+
url = uri("${layout.buildDirectory}/repo")
160127
}
161128
}
162129
}

0 commit comments

Comments
 (0)