Skip to content

Commit e66764d

Browse files
authored
Merge pull request #12 from Smithor/Feature-BuildJavadocAndSourcesJars
Adding Javadoc and sources jar to build/publish
2 parents d6703fc + ac8b9ef commit e66764d

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ java {
1515
toolchain {
1616
languageVersion = JavaLanguageVersion.of(17)
1717
}
18+
withJavadocJar()
19+
withSourcesJar()
20+
}
21+
22+
sourcesJar {
23+
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
1824
}
1925

2026
repositories { mavenCentral() }
@@ -26,8 +32,26 @@ tasks.withType(JavaCompile).configureEach {
2632
options.compilerArgs << "-parameters"
2733
}
2834

35+
tasks.publish.doFirst() {
36+
def user = System.getenv("GITHUB_USER")
37+
def pw = System.getenv("GITHUB_TOKEN")
38+
println "Publish start user:$user"
39+
}
40+
2941
publishing {
3042

43+
repositories {
44+
maven {
45+
name = "GitHubPackages"
46+
url = "https://maven.pkg.github.com/reportmill/SnapKit"
47+
credentials {
48+
username = System.getenv("GITHUB_USER")
49+
password = System.getenv("GITHUB_TOKEN")
50+
println "Publish user: username=$username"
51+
}
52+
}
53+
}
54+
3155
publications {
3256
gpr(MavenPublication) {
3357
artifactId = 'snapkit'

0 commit comments

Comments
 (0)