Skip to content

Commit 6df9603

Browse files
committed
Mess around with nmcp
1 parent 8d29211 commit 6df9603

12 files changed

Lines changed: 75 additions & 40 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v3
10-
- name: Set up JDK 11
10+
- name: Set up JDK 17
1111
uses: actions/setup-java@v3
1212
with:
13-
java-version: '11'
13+
java-version: '17'
1414
distribution: 'adopt'
1515
- name: Validate Gradle wrapper
1616
uses: gradle/actions/wrapper-validation@v3

.github/workflows/release.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
- os: ubuntu-latest
1414
# On ubuntu publish everything you can i.e. the linuxX64 and jvm binaries
1515
# (Need to do >- or for some reason it preserves a newline after all the entries)
16-
publish_command: build publishLinux
16+
publish_command: build publishAggregationToCentralPortal
1717
platform: linux
1818
- os: macOS-latest
19-
publish_command: build publishMac
19+
publish_command: build publishAggregationToCentralPortal
2020
platform: mac
2121
- os: windows-latest
22-
publish_command: build publishWindows
22+
publish_command: build publishAggregationToCentralPortal
2323
platform: windows
2424
env:
2525
SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
@@ -29,19 +29,14 @@ jobs:
2929
MATRIX_OS: ${{ matrix.os }}
3030
steps:
3131
- uses: actions/checkout@v3
32-
- name: Set up JDK 11
32+
- name: Set up JDK 17
3333
uses: actions/setup-java@v3
3434
with:
35-
java-version: '11'
35+
java-version: '17'
3636
distribution: 'adopt'
3737
- name: Validate Gradle wrapper
3838
uses: gradle/actions/wrapper-validation@v3
3939
- run: echo "*************** PublishCommand ${{ matrix.publish_command }}"
40-
41-
- id: create_staging_repo
42-
name: Create Central staging repo (Gradle)
43-
run: ./gradlew startSonatypeStaging --no-daemon
44-
4540
- name: Publish the project
4641
shell: bash
4742
env:
@@ -56,10 +51,10 @@ jobs:
5651
SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
5752
steps:
5853
- uses: actions/checkout@v3
59-
- name: Set up JDK 11
54+
- name: Set up JDK 17
6055
uses: actions/setup-java@v3
6156
with:
62-
java-version: '11'
57+
java-version: '17'
6358
distribution: 'adopt'
6459
- name: Validate Gradle wrapper
6560
uses: gradle/actions/wrapper-validation@v3
@@ -78,10 +73,10 @@ jobs:
7873
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
7974
steps:
8075
- uses: actions/checkout@v3
81-
- name: Set up JDK 11
76+
- name: Set up JDK 17
8277
uses: actions/setup-java@v3
8378
with:
84-
java-version: '11'
79+
java-version: '17'
8580
distribution: 'adopt'
8681
- name: Validate Gradle wrapper
8782
uses: gradle/actions/wrapper-validation@v3

build-logic/src/main/kotlin/conventions-multiplatform.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ kotlin {
2020
val isMac = platform == "mac"
2121
val isWindows = platform == "windows"
2222

23-
jvmToolchain(11)
23+
jvmToolchain(17)
2424
val isLocalMultiplatform = project.hasProperty("isLocalMultiplatform")
2525

2626
jvm {

build-logic/src/main/kotlin/publish-jvm.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ repositories {
2222
tasks {
2323
compileKotlin {
2424
kotlinOptions.suppressWarnings = true
25-
kotlinOptions.jvmTarget = "11"
25+
kotlinOptions.jvmTarget = "17"
2626
}
2727

2828
compileJava {
29-
sourceCompatibility = "11"
30-
targetCompatibility = "11"
29+
sourceCompatibility = "17"
30+
targetCompatibility = "17"
3131
}
3232

3333
compileTestKotlin {
34-
kotlinOptions.jvmTarget = "11"
34+
kotlinOptions.jvmTarget = "17"
3535
}
3636

3737
compileTestJava {
@@ -40,14 +40,14 @@ tasks {
4040
}
4141

4242
java {
43-
sourceCompatibility = JavaVersion.VERSION_11
44-
targetCompatibility = JavaVersion.VERSION_11
43+
sourceCompatibility = JavaVersion.VERSION_17
44+
targetCompatibility = JavaVersion.VERSION_17
4545
}
4646

4747
// Can also do this instead of above, for more details
4848
// see here: https://stackoverflow.com/questions/69079963/how-to-set-compilejava-task-11-and-compilekotlin-task-1-8-jvm-target-com
4949
// java {
50-
// toolchain.languageVersion.set(JavaLanguageVersion.of(11))
50+
// toolchain.languageVersion.set(JavaLanguageVersion.of(17))
5151
// }
5252

5353
// Disable publishing for decomat examples
@@ -93,7 +93,7 @@ publishing {
9393
setUrl {
9494
val repositoryId = System.getenv("STAGING_REPO_ID")
9595
if (repositoryId.trim().isEmpty() || repositoryId.trim() == "") error("STAGING_REPO_ID is empty")
96-
"https://ossrh-staging-api.central.sonatype.com/service/local/staging/deployByRepositoryId/$repositoryId/"
96+
"https://ossrh-staging-api.central.sonatype.com/service/local/staging/maven2/"
9797
}
9898
credentials {
9999
username = user

build-logic/src/main/kotlin/publish.gradle.kts

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ plugins {
88
signing
99
id("io.github.gradle-nexus.publish-plugin")
1010
id("org.jetbrains.dokka")
11+
//id("com.gradleup.nmcp.aggregation")
1112
}
1213

1314
apply(plugin = "io.github.gradle-nexus.publish-plugin")
@@ -18,16 +19,29 @@ repositories {
1819
}
1920

2021

22+
//nmcpAggregation {
23+
// centralPortal {
24+
// username = System.getenv("SONATYPE_USERNAME") ?: error("SONATYPE_USERNAME not set")
25+
// password = System.getenv("SONATYPE_PASSWORD") ?: error("SONATYPE_PASSWORD not set")
26+
// // publish manually from the portal
27+
// publishingType = "USER_MANAGED"
28+
// }
29+
//
30+
// // Publish all projects that apply the 'maven-publish' plugin
31+
// publishAllProjectsProbablyBreakingProjectIsolation()
32+
//}
33+
34+
2135
// Disable publishing for testing project
2236
tasks.withType<PublishToMavenRepository>().configureEach {
2337
gradle.startParameter.maxWorkerCount = 1
2438

25-
if (HostManager.hostIsMac) {
26-
doLast {
27-
logger.lifecycle("Sleeping 120 s after $name")
28-
Thread.sleep(20_000)
29-
}
30-
}
39+
//if (HostManager.hostIsMac) {
40+
// doLast {
41+
// logger.lifecycle("Sleeping 120 s after $name")
42+
// Thread.sleep(20_000)
43+
// }
44+
//}
3145

3246
onlyIf {
3347
publication.artifactId != "testing"
@@ -55,7 +69,7 @@ publishing {
5569
setUrl {
5670
val repositoryId = System.getenv("STAGING_REPO_ID")
5771
if (repositoryId.trim().isEmpty() || repositoryId.trim() == "") error("STAGING_REPO_ID is empty")
58-
"https://ossrh-staging-api.central.sonatype.com/service/local/staging/deployByRepositoryId/$repositoryId/"
72+
"https://ossrh-staging-api.central.sonatype.com/service/local/staging/maven2/"
5973
}
6074
credentials {
6175
username = user
@@ -154,7 +168,6 @@ tasks.withType<Sign>().configureEach {
154168
// I tried a few things that caused other issues. Ultimately the working solution I got from here:
155169
// https://github.com/gradle/gradle/issues/26091#issuecomment-1722947958
156170
tasks.withType<AbstractPublishToMaven>().configureEach {
157-
gradle.startParameter.maxWorkerCount = 1
158171
val signingTasks = tasks.withType<Sign>()
159172
mustRunAfter(signingTasks)
160173

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id("io.github.gradle-nexus.publish-plugin") version "1.1.0" apply false
44
}
55

6+
67
allprojects {
78
repositories {
89
mavenCentral()

gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
22
org.gradle.configureondemand=false
33
org.gradle.workers.max=1
4+
org.gradle.java.installations.auto-detect=true
5+
org.gradle.java.installations.auto-download=true
6+
org.gradle.toolchains.foojay-resolver-convention.version=0.7.0
7+
kotlin.jvm.target.validation.mode=ignore

settings.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
pluginManagement {
22
includeBuild("terpal-plugin-gradle")
33
includeBuild("build-logic")
4+
5+
pluginManagement {
6+
repositories {
7+
mavenCentral()
8+
google()
9+
gradlePluginPortal()
10+
mavenLocal()
11+
}
12+
}
413
}
514

615
includeBuild("terpal-runtime")

terpal-plugin-gradle/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
kotlin {
14-
jvmToolchain(11)
14+
jvmToolchain(17)
1515
}
1616

1717
val conventionsDecomatVersion = Conventions_gradle.Versions.decomatVersion

terpal-plugin-kotlin/build.gradle.kts

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

1111
kotlin {
12-
jvmToolchain(11)
12+
jvmToolchain(17)
1313
}
1414

1515
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
@@ -18,13 +18,13 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEa
1818
// Otherwise will have: Could not resolve io.exoquery:pprint-kotlin:2.0.1.
1919
// Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
2020
java {
21-
sourceCompatibility = JavaVersion.VERSION_11
22-
targetCompatibility = JavaVersion.VERSION_11
21+
sourceCompatibility = JavaVersion.VERSION_17
22+
targetCompatibility = JavaVersion.VERSION_17
2323
}
2424
// If I remove this I get:
2525
// 'compileJava' task (current target is 11) and 'kaptGenerateStubsKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
2626
// Not sure why
27-
jvmTarget.set(JvmTarget.JVM_11)
27+
jvmTarget.set(JvmTarget.JVM_17)
2828
}
2929
}
3030

0 commit comments

Comments
 (0)