@@ -64,109 +64,6 @@ allprojects {
6464 }
6565}
6666
67- // Make javadoc task errors not break the build, some are in third-party code.
68- if (JavaVersion .current().isJava8Compatible) {
69- allprojects {
70- tasks.withType<Javadoc > {
71- isFailOnError = false
72- }
73- }
74- }
75-
76- val projectNamesToPublish = listOf (
77- " objectbox-java-api" ,
78- " objectbox-java" ,
79- " objectbox-kotlin" ,
80- " objectbox-rxjava" ,
81- " objectbox-rxjava3"
82- )
83-
84- fun hasSigningProperties (): Boolean {
85- return (project.hasProperty(" signingKeyId" )
86- && project.hasProperty(" signingKeyFile" )
87- && project.hasProperty(" signingPassword" ))
88- }
89-
90- configure(subprojects.filter { projectNamesToPublish.contains(it.name) }) {
91- apply (plugin = " maven-publish" )
92- apply (plugin = " signing" )
93-
94- configure<PublishingExtension > {
95- repositories {
96- maven {
97- name = " GitLab"
98- if (project.hasProperty(" gitlabUrl" ) && project.hasProperty(" gitlabPrivateToken" )) {
99- // "https://gitlab.example.com/api/v4/projects/<PROJECT_ID>/packages/maven"
100- val gitlabUrl = project.property(" gitlabUrl" )
101- url = uri(" $gitlabUrl /api/v4/projects/14/packages/maven" )
102- println (" GitLab repository set to $url ." )
103-
104- credentials(HttpHeaderCredentials ::class ) {
105- name = project.findProperty(" gitlabTokenName" )?.toString() ? : " Private-Token"
106- value = project.property(" gitlabPrivateToken" ).toString()
107- }
108- authentication {
109- create<HttpHeaderAuthentication >(" header" )
110- }
111- } else {
112- println (" WARNING: Can not publish to GitLab: gitlabUrl or gitlabPrivateToken not set." )
113- }
114- }
115- // Note: Sonatype repo created by publish-plugin.
116- }
117-
118- publications {
119- create<MavenPublication >(" mavenJava" ) {
120- // Note: Projects set additional specific properties.
121- pom {
122- packaging = " jar"
123- url.set(" https://objectbox.io" )
124- licenses {
125- license {
126- name.set(" The Apache Software License, Version 2.0" )
127- url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
128- distribution.set(" repo" )
129- }
130- }
131- developers {
132- developer {
133- id.set(" ObjectBox" )
134- name.set(" ObjectBox" )
135- }
136- }
137- issueManagement {
138- system.set(" GitHub Issues" )
139- url.set(" https://github.com/objectbox/objectbox-java/issues" )
140- }
141- organization {
142- name.set(" ObjectBox Ltd." )
143- url.set(" https://objectbox.io" )
144- }
145- scm {
146- connection.set(
" scm:[email protected] :objectbox/objectbox-java.git" )
147- developerConnection.set(
" scm:[email protected] :objectbox/objectbox-java.git" )
148- url.set(" https://github.com/objectbox/objectbox-java" )
149- }
150- }
151- }
152- }
153- }
154-
155- configure<SigningExtension > {
156- if (hasSigningProperties()) {
157- val signingKey = File (project.property(" signingKeyFile" ).toString()).readText()
158- useInMemoryPgpKeys(
159- project.property(" signingKeyId" ).toString(),
160- signingKey,
161- project.property(" signingPassword" ).toString()
162- )
163- sign((extensions.getByName(" publishing" ) as PublishingExtension ).publications[" mavenJava" ])
164- } else {
165- println (" Signing information missing/incomplete for ${project.name} " )
166- }
167- }
168- }
169-
17067tasks.wrapper {
17168 distributionType = Wrapper .DistributionType .ALL
17269}
0 commit comments