Skip to content

Commit 7d48d65

Browse files
committed
follow the compose-audio-control way on the new publication setup.
1 parent 56460b4 commit 7d48d65

File tree

9 files changed

+202
-158
lines changed

9 files changed

+202
-158
lines changed

.github/workflows/deploy.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,14 @@ jobs:
2121
with:
2222
java-version: 17
2323
distribution: temurin
24-
- name: setup gpg necessities
25-
run: sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > $WORKSPACE/'$SIGNING_SECRET_KEY_RING_FILE'"
26-
env:
27-
WORKSPACE: ${{ github.workspace }}
28-
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
29-
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
30-
- name: Import GPG key
31-
uses: crazy-max/ghaction-import-gpg@v5
32-
with:
33-
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
34-
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
3524
- name: publish
36-
run: ./gradlew
37-
-PmavenCentralUsername=${{ secrets.OSSRH_USERNAME }}
38-
-PmavenCentralPassword=${{ secrets.OSSRH_PASSWORD }}
39-
-PsigningInMemoryKeyId=${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}
40-
-PsigningInMemoryPassword=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
41-
--warning-mode=all publish dokkaHtml
25+
run: ./gradlew --warning-mode=all publishToMavenCentral dokkaHtml
26+
env:
27+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
28+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
29+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
30+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }}
31+
4232
- name: upload artifact
4333
if: false #success()
4434
uses: actions/upload-artifact@v4

androidaudioplugin-manager/build.gradle.kts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ apply { from ("../common.gradle") }
1212

1313
// What a mess...
1414
val enable_asan: Boolean by rootProject
15+
version = libs.versions.aap.core.get()
1516

1617
android {
1718
namespace = "org.androidaudioplugin.manager"
@@ -62,13 +63,6 @@ android {
6263
}
6364
}
6465

65-
apply { from ("../publish-pom.gradle") }
66-
// "mavenPublishing" could not resolve reference to com.vanniktech.maven.publish.SonatypeHost. Another reason Gradle should die.
67-
mavenPublishing {
68-
configure(AndroidMultiVariantLibrary())
69-
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
70-
}
71-
7266
dependencies {
7367
implementation (project(":androidaudioplugin"))
7468
implementation (libs.androidx.core.ktx)
@@ -82,11 +76,30 @@ dependencies {
8276
androidTestImplementation (libs.test.espresso.core)
8377
}
8478

85-
/*
86-
// Starting AGP 7.0.0-alpha05, AGP stopped caring build dependencies and it broke builds.
87-
// This is a forcible workarounds to build libandroidaudioplugin.so in prior to referencing it.
88-
gradle.projectsEvaluated {
89-
tasks.findByPath(":androidaudioplugin-manager:buildCMakeDebug")!!.dependsOn(":androidaudioplugin:prefabDebugPackage")
90-
tasks.findByPath(":androidaudioplugin-manager:buildCMakeRelWithDebInfo")!!.dependsOn(":androidaudioplugin:prefabReleasePackage")
79+
80+
val gitProjectName = "aap-core"
81+
val packageName = project.name
82+
val packageDescription = android.ext["description"].toString()
83+
// my common settings
84+
val packageUrl = "https://github.com/atsushieno/$gitProjectName"
85+
val licenseName = "MIT"
86+
val licenseUrl = "https://github.com/atsushieno/$gitProjectName/blob/main/LICENSE"
87+
val devId = "atsushieno"
88+
val devName = "Atsushi Eno"
89+
val devEmail = "atsushieno@gmail.com"
90+
91+
// Common copy-pasted
92+
mavenPublishing {
93+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
94+
if (project.hasProperty("mavenCentralUsername") || System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null)
95+
signAllPublications()
96+
coordinates(group.toString(), project.name, version.toString())
97+
pom {
98+
name.set(packageName)
99+
description.set(packageDescription)
100+
url.set(packageUrl)
101+
scm { url.set(packageUrl) }
102+
licenses { license { name.set(licenseName); url.set(licenseUrl) } }
103+
developers { developer { id.set(devId); name.set(devName); email.set(devEmail) } }
104+
}
91105
}
92-
*/

androidaudioplugin-midi-device-service/build.gradle.kts

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ plugins {
1111
apply { from ("../common.gradle") }
1212

1313
// What a mess...
14+
version = libs.versions.aap.core.get()
1415
val enable_asan: Boolean by rootProject
1516

1617
android {
@@ -62,13 +63,6 @@ android {
6263
}
6364
}
6465

65-
apply { from ("../publish-pom.gradle") }
66-
// "mavenPublishing" could not resolve reference to com.vanniktech.maven.publish.SonatypeHost. Another reason Gradle should die.
67-
mavenPublishing {
68-
configure(AndroidMultiVariantLibrary())
69-
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
70-
}
71-
7266
dependencies {
7367
implementation (project(":androidaudioplugin"))
7468
implementation (libs.androidx.core.ktx)
@@ -81,13 +75,29 @@ dependencies {
8175
androidTestImplementation (libs.test.espresso.core)
8276
}
8377

84-
/*
85-
// Starting AGP 7.0.0-alpha05, AGP stopped caring build dependencies and it broke builds.
86-
// This is a forcible workarounds to build libandroidaudioplugin.so in prior to referencing it.
87-
gradle.projectsEvaluated {
88-
tasks.findByPath(":androidaudioplugin-midi-device-service:buildCMakeDebug")!!.dependsOn(":androidaudioplugin:prefabDebugPackage")
89-
tasks.findByPath(":androidaudioplugin-midi-device-service:buildCMakeRelWithDebInfo")!!.dependsOn(":androidaudioplugin:prefabReleasePackage")
90-
//tasks["mergeDebugNativeLibs"].dependsOn(rootProject.project("androidaudioplugin").tasks["prefabDebugPackage"])
91-
//tasks["mergeReleaseNativeLibs"].dependsOn(rootProject.project("androidaudioplugin").tasks["prefabReleasePackage"])
78+
val gitProjectName = "aap-core"
79+
val packageName = project.name
80+
val packageDescription = android.ext["description"].toString()
81+
// my common settings
82+
val packageUrl = "https://github.com/atsushieno/$gitProjectName"
83+
val licenseName = "MIT"
84+
val licenseUrl = "https://github.com/atsushieno/$gitProjectName/blob/main/LICENSE"
85+
val devId = "atsushieno"
86+
val devName = "Atsushi Eno"
87+
val devEmail = "atsushieno@gmail.com"
88+
89+
// Common copy-pasted
90+
mavenPublishing {
91+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
92+
if (project.hasProperty("mavenCentralUsername") || System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null)
93+
signAllPublications()
94+
coordinates(group.toString(), project.name, version.toString())
95+
pom {
96+
name.set(packageName)
97+
description.set(packageDescription)
98+
url.set(packageUrl)
99+
scm { url.set(packageUrl) }
100+
licenses { license { name.set(licenseName); url.set(licenseUrl) } }
101+
developers { developer { id.set(devId); name.set(devName); email.set(devEmail) } }
102+
}
92103
}
93-
*/

androidaudioplugin-testing/build.gradle.kts

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ plugins {
99
}
1010

1111
apply { from ("../common.gradle") }
12+
version = libs.versions.aap.core.get()
1213

1314
android {
1415
namespace = "org.androidaudioplugin.androidaudioplugin.testing"
@@ -22,13 +23,6 @@ android {
2223
}
2324
}
2425

25-
apply { from ("../publish-pom.gradle") }
26-
// "mavenPublishing" could not resolve reference to com.vanniktech.maven.publish.SonatypeHost. Another reason Gradle should die.
27-
mavenPublishing {
28-
configure(AndroidMultiVariantLibrary())
29-
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
30-
}
31-
3226
dependencies {
3327
implementation (project(":androidaudioplugin"))
3428

@@ -43,3 +37,30 @@ dependencies {
4337
androidTestImplementation (libs.test.ext.junit)
4438
androidTestImplementation (libs.test.espresso.core)
4539
}
40+
41+
val gitProjectName = "aap-core"
42+
val packageName = project.name
43+
val packageDescription = android.ext["description"].toString()
44+
// my common settings
45+
val packageUrl = "https://github.com/atsushieno/$gitProjectName"
46+
val licenseName = "MIT"
47+
val licenseUrl = "https://github.com/atsushieno/$gitProjectName/blob/main/LICENSE"
48+
val devId = "atsushieno"
49+
val devName = "Atsushi Eno"
50+
val devEmail = "atsushieno@gmail.com"
51+
52+
// Common copy-pasted
53+
mavenPublishing {
54+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
55+
if (project.hasProperty("mavenCentralUsername") || System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null)
56+
signAllPublications()
57+
coordinates(group.toString(), project.name, version.toString())
58+
pom {
59+
name.set(packageName)
60+
description.set(packageDescription)
61+
url.set(packageUrl)
62+
scm { url.set(packageUrl) }
63+
licenses { license { name.set(licenseName); url.set(licenseUrl) } }
64+
developers { developer { id.set(devId); name.set(devName); email.set(devEmail) } }
65+
}
66+
}

androidaudioplugin-ui-compose-app/build.gradle.kts

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ plugins {
1010
}
1111

1212
apply { from ("../common.gradle") }
13+
version = libs.versions.aap.core.get()
1314

1415
android {
1516
namespace = "org.androidaudioplugin.ui.compose.app"
@@ -43,13 +44,6 @@ android {
4344
}
4445
}
4546

46-
apply { from ("../publish-pom.gradle") }
47-
// "mavenPublishing" could not resolve reference to com.vanniktech.maven.publish.SonatypeHost. Another reason Gradle should die.
48-
mavenPublishing {
49-
configure(AndroidMultiVariantLibrary())
50-
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
51-
}
52-
5347
dependencies {
5448
implementation (project(":androidaudioplugin"))
5549
implementation (project(":androidaudioplugin-manager"))
@@ -74,3 +68,30 @@ dependencies {
7468
androidTestImplementation (libs.test.espresso.core)
7569
androidTestImplementation(platform(libs.compose.bom))
7670
}
71+
72+
val gitProjectName = "aap-core"
73+
val packageName = project.name
74+
val packageDescription = android.ext["description"].toString()
75+
// my common settings
76+
val packageUrl = "https://github.com/atsushieno/$gitProjectName"
77+
val licenseName = "MIT"
78+
val licenseUrl = "https://github.com/atsushieno/$gitProjectName/blob/main/LICENSE"
79+
val devId = "atsushieno"
80+
val devName = "Atsushi Eno"
81+
val devEmail = "atsushieno@gmail.com"
82+
83+
// Common copy-pasted
84+
mavenPublishing {
85+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
86+
if (project.hasProperty("mavenCentralUsername") || System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null)
87+
signAllPublications()
88+
coordinates(group.toString(), project.name, version.toString())
89+
pom {
90+
name.set(packageName)
91+
description.set(packageDescription)
92+
url.set(packageUrl)
93+
scm { url.set(packageUrl) }
94+
licenses { license { name.set(licenseName); url.set(licenseUrl) } }
95+
developers { developer { id.set(devId); name.set(devName); email.set(devEmail) } }
96+
}
97+
}

androidaudioplugin-ui-compose/build.gradle.kts

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ plugins {
1010
}
1111

1212
apply { from ("../common.gradle") }
13+
version = libs.versions.aap.core.get()
1314

1415
android {
1516
namespace = "org.androidaudioplugin.ui.compose"
@@ -43,13 +44,6 @@ android {
4344
}
4445
}
4546

46-
apply { from ("../publish-pom.gradle") }
47-
// "mavenPublishing" could not resolve reference to com.vanniktech.maven.publish.SonatypeHost. Another reason Gradle should die.
48-
mavenPublishing {
49-
configure(AndroidMultiVariantLibrary())
50-
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
51-
}
52-
5347
dependencies {
5448
implementation (project(":androidaudioplugin"))
5549
implementation (libs.compose.audio.controls)
@@ -70,3 +64,31 @@ dependencies {
7064
androidTestImplementation (libs.test.espresso.core)
7165
androidTestImplementation(platform(libs.compose.bom))
7266
}
67+
68+
69+
val gitProjectName = "aap-core"
70+
val packageName = project.name
71+
val packageDescription = android.ext["description"].toString()
72+
// my common settings
73+
val packageUrl = "https://github.com/atsushieno/$gitProjectName"
74+
val licenseName = "MIT"
75+
val licenseUrl = "https://github.com/atsushieno/$gitProjectName/blob/main/LICENSE"
76+
val devId = "atsushieno"
77+
val devName = "Atsushi Eno"
78+
val devEmail = "atsushieno@gmail.com"
79+
80+
// Common copy-pasted
81+
mavenPublishing {
82+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
83+
if (project.hasProperty("mavenCentralUsername") || System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null)
84+
signAllPublications()
85+
coordinates(group.toString(), project.name, version.toString())
86+
pom {
87+
name.set(packageName)
88+
description.set(packageDescription)
89+
url.set(packageUrl)
90+
scm { url.set(packageUrl) }
91+
licenses { license { name.set(licenseName); url.set(licenseUrl) } }
92+
developers { developer { id.set(devId); name.set(devName); email.set(devEmail) } }
93+
}
94+
}

androidaudioplugin-ui-web/build.gradle.kts

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ plugins {
99
}
1010

1111
apply { from ("../common.gradle") }
12+
version = libs.versions.aap.core.get()
1213

1314
android {
1415
namespace = "org.androidaudioplugin.ui.web"
@@ -22,13 +23,6 @@ android {
2223
}
2324
}
2425

25-
apply { from ("../publish-pom.gradle") }
26-
// "mavenPublishing" could not resolve reference to com.vanniktech.maven.publish.SonatypeHost. Another reason Gradle should die.
27-
mavenPublishing {
28-
configure(AndroidMultiVariantLibrary())
29-
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
30-
}
31-
3226
dependencies {
3327
implementation (project(":androidaudioplugin"))
3428
implementation (libs.androidx.core.ktx)
@@ -41,3 +35,31 @@ dependencies {
4135
androidTestImplementation (libs.test.ext.junit)
4236
androidTestImplementation (libs.test.espresso.core)
4337
}
38+
39+
40+
val gitProjectName = "aap-core"
41+
val packageName = project.name
42+
val packageDescription = android.ext["description"].toString()
43+
// my common settings
44+
val packageUrl = "https://github.com/atsushieno/$gitProjectName"
45+
val licenseName = "MIT"
46+
val licenseUrl = "https://github.com/atsushieno/$gitProjectName/blob/main/LICENSE"
47+
val devId = "atsushieno"
48+
val devName = "Atsushi Eno"
49+
val devEmail = "atsushieno@gmail.com"
50+
51+
// Common copy-pasted
52+
mavenPublishing {
53+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
54+
if (project.hasProperty("mavenCentralUsername") || System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null)
55+
signAllPublications()
56+
coordinates(group.toString(), project.name, version.toString())
57+
pom {
58+
name.set(packageName)
59+
description.set(packageDescription)
60+
url.set(packageUrl)
61+
scm { url.set(packageUrl) }
62+
licenses { license { name.set(licenseName); url.set(licenseUrl) } }
63+
developers { developer { id.set(devId); name.set(devName); email.set(devEmail) } }
64+
}
65+
}

0 commit comments

Comments
 (0)