Skip to content

Commit c3d7995

Browse files
haydenbakermtdowling
authored andcommitted
Add sources and javadoc jars, Fix staging directory
1 parent e5f65e2 commit c3d7995

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jreleaser {
6666
snapshotUrl = "https://aws.oss.sonatype.org/content/repositories/snapshots"
6767
closeRepository.set(true)
6868
releaseRepository.set(true)
69-
stagingRepositories.add("${rootProject.buildDir}/staging")
69+
verifyPom.set(true)
70+
stagingRepository(rootProject.layout.buildDirectory.dir("staging").get().asFile.path)
7071
}
7172
}
7273
}

buildSrc/src/main/kotlin/smithy-java.module-conventions.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ val licenseSpec = copySpec {
2525
* Extra Jars
2626
* ============================
2727
*/
28-
// Build a javadoc JAR too.
29-
tasks.register<Jar>("javadocJar") {
30-
from(tasks.named("javadoc"))
31-
archiveClassifier.set("javadoc")
28+
java {
29+
withJavadocJar()
30+
withSourcesJar()
3231
}
3332

3433
// TODO: Remove this once package is ready for docs

buildSrc/src/main/kotlin/smithy-java.publishing-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ publishing {
1717
repositories {
1818
maven {
1919
name = "stagingRepository"
20-
url = uri("${rootProject.layout.buildDirectory}/staging")
20+
url = rootProject.layout.buildDirectory.dir("staging").get().asFile.toURI()
2121
}
2222
}
2323
// Add license spec to all maven publications

framework-errors/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,21 @@ afterEvaluate {
3434
}
3535
}
3636

37+
// TODO: This is needed because the type-mapping file is mapped (twice) in the source-set above and source-set below,
38+
// but really we shouldn't be doing that
39+
tasks.withType<Jar> {
40+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
41+
}
42+
3743
tasks.named("compileJava") {
3844
dependsOn("smithyBuild")
3945
}
4046

47+
// Needed because sources-jar needs to run after smithy-build is done
48+
tasks.named("sourcesJar") {
49+
mustRunAfter("compileJava")
50+
}
51+
4152
// Helps Intellij plugin identify models
4253
sourceSets {
4354
main {

0 commit comments

Comments
 (0)