@@ -43,7 +43,6 @@ gradlePlugin {
4343 }
4444}
4545
46-
4746tasks.withType<Test >().configureEach {
4847 useJUnitPlatform()
4948}
@@ -62,7 +61,7 @@ val implCls: Configuration by configurations.creating {
6261val javadocs by tasks.registering(Javadoc ::class ) {
6362 title = " ${project.ext.get(" plugin_display_name" )} ${project.ext.get(" plugin_version" )} API"
6463 classpath + = implCls.asFileTree.filter {it.extension == " jar" }
65- setDestinationDir(project .file(" / build/javadoc" ) )
64+ destinationDir = rootProject .file(" build/javadoc" )
6665 source = sourceSets.main.get().allJava
6766 // options.links = "https://docs.oracle.com/en/java/javase/17/docs/api/"
6867 // options.linkSource = true
@@ -72,7 +71,7 @@ val javadocs by tasks.registering(Javadoc::class) {
7271
7372val javadocJar by tasks.registering(Jar ::class ) {
7473 archiveClassifier.set(" javadoc" )
75- from(project .file(" / build/javadoc" ))
74+ from(rootProject .file(" build/javadoc" ))
7675 dependsOn(javadocs)
7776}
7877
@@ -89,23 +88,49 @@ artifacts {
8988 archives(sourcesJar)
9089}
9190
92- afterEvaluate {
93- publishing {
94- publications {
95- create<MavenPublication >(" release" ) {
96- from(components.getByName(" java" ))
97- groupId = " ${project.ext.get(" group_id" )} "
98- artifactId = " ${project.ext.get(" plugin_identifier" )} "
99- version = " ${project.ext.get(" plugin_version" )} "
100- pom {
101- name = " ${project.ext.get(" plugin_display_name" )} "
102- description = " ${project.ext.get(" plugin_description" )} "
103- url = " https://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} "
104- scm {
105- connection = " scm:git:git://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} .git"
106- developerConnection = " scm:git:ssh://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} .git"
107- url = " https://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} /"
108- }
91+ configure<PublishingExtension > {
92+ repositories {
93+ maven {
94+ name = " GitHubPackages"
95+ url = uri(" https://maven.pkg.github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} " )
96+ credentials {
97+ username = System .getenv(" GITHUB_ACTOR" )
98+ password = System .getenv(" GITHUB_TOKEN" )
99+ }
100+ }
101+ }
102+ publications {
103+
104+ register<MavenPublication >(" GitHub" ) {
105+ from(components.getByName(" java" ))
106+ groupId = " ${project.ext.get(" group_id" )} "
107+ artifactId = " ${project.ext.get(" plugin_identifier" )} "
108+ version = " ${project.ext.get(" plugin_version" )} "
109+ pom {
110+ name = " ${project.ext.get(" plugin_display_name" )} "
111+ description = " ${project.ext.get(" plugin_description" )} "
112+ url = " https://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} "
113+ scm {
114+ connection = " scm:git:git://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} .git"
115+ developerConnection = " scm:git:ssh://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} .git"
116+ url = " https://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} /"
117+ }
118+ }
119+ }
120+
121+ register<MavenPublication >(" JitPack" ) {
122+ from(components.getByName(" java" ))
123+ groupId = " ${project.ext.get(" group_id" )} "
124+ artifactId = " ${project.ext.get(" plugin_identifier" )} "
125+ version = " ${project.ext.get(" plugin_version" )} "
126+ pom {
127+ name = " ${project.ext.get(" plugin_display_name" )} "
128+ description = " ${project.ext.get(" plugin_description" )} "
129+ url = " https://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} "
130+ scm {
131+ connection = " scm:git:git://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} .git"
132+ developerConnection = " scm:git:ssh://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} .git"
133+ url = " https://github.com/${project.ext.get(" github_handle" )} /${project.ext.get(" plugin_identifier" )} /"
109134 }
110135 }
111136 }
0 commit comments