Skip to content

Commit 1e11eb2

Browse files
committed
fix mavencentral publishing
1 parent de72e9c commit 1e11eb2

File tree

1 file changed

+58
-52
lines changed

1 file changed

+58
-52
lines changed

androidplot-core/build.gradle

+58-52
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ class AttrMarkdown extends DefaultTask {
3131
def input = project.file(inFile)
3232

3333
def output = project.file(outFile)
34-
if(output.exists()) {
34+
if (output.exists()) {
3535
output.delete()
3636
}
3737
output.parentFile.mkdirs()
3838

39-
input.text.findAll(/<!--\n?([\s\S]*?)\n?-->/) { match, g1 -> g1
40-
if(!g1.startsWith("NODOC")) {
39+
input.text.findAll(/<!--\n?([\s\S]*?)\n?-->/) { match, g1 ->
40+
g1
41+
if (!g1.startsWith("NODOC")) {
4142
output.append(g1)
4243
output.append "\n\n"
4344
}
@@ -53,7 +54,7 @@ class AttrMarkdown extends DefaultTask {
5354
* The generated doc will appear in / replace androidplot/docs/attrs.md
5455
*/
5556
task generateAttrsMarkdown(type: AttrMarkdown) {
56-
inFile = { "src/main/res/values/attrs.xml"}
57+
inFile = { "src/main/res/values/attrs.xml" }
5758
outFile = { "../docs/attrs.md" }
5859
}
5960

@@ -85,6 +86,13 @@ android {
8586
}
8687
namespace 'com.androidplot'
8788

89+
publishing {
90+
singleVariant("release") {
91+
//withSourcesJar()
92+
//withJavadocJar()
93+
}
94+
}
95+
8896
}
8997

9098
group = 'com.androidplot'
@@ -121,65 +129,63 @@ dependencies {
121129
// from javadoc.destinationDir
122130
//}
123131

124-
task sourcesJar(type: Jar) {
125-
archiveClassifier.set('sources')
126-
from android.sourceSets.main.java.srcDirs
127-
}
132+
//task sourcesJar(type: Jar) {
133+
// archiveClassifier.set('sources')
134+
// from android.sourceSets.main.java.srcDirs
135+
//}
128136

129137
// TODO: get javadoc working again at some point
130138
//javadoc {
131139
// options.overview = "src/main/java/overview.html"
132140
//}
133141

134-
afterEvaluate {
135-
publishing {
136-
repositories {
137-
maven {
138-
name = "Maven Central"
139-
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
140-
credentials {
141-
username = System.getenv("OSSRH_ACTOR")
142-
password = System.getenv("OSSRH_TOKEN")
143-
}
142+
publishing {
143+
repositories {
144+
maven {
145+
name = "MavenCentral"
146+
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
147+
credentials {
148+
username = System.getenv("OSSRH_ACTOR")
149+
password = System.getenv("OSSRH_TOKEN")
144150
}
145151
}
152+
}
146153

147-
publications {
154+
publications {
148155

149-
publications.withType(MavenPublication) {
156+
publications.withType(MavenPublication) {
150157
// release(MavenPublication) {
151158
//
152159
// from components.release
153160

154-
// You can then customize attributes of the publication as shown below.
155-
groupId = 'com.androidplot'
156-
artifactId = 'androidplot-core'
157-
version = theVersionName
158-
159-
pom {
160-
packaging 'aar'
161-
name = 'Androidplot'
162-
description = "Configure any object from XML."
163-
url = gitUrl
164-
licenses {
165-
license {
166-
name = 'The Apache Software License, Version 2.0'
167-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
168-
}
161+
// You can then customize attributes of the publication as shown below.
162+
groupId = 'com.androidplot'
163+
artifactId = 'androidplot-core'
164+
version = theVersionName
165+
166+
pom {
167+
packaging 'aar'
168+
name = 'Androidplot'
169+
description = "Configure any object from XML."
170+
url = gitUrl
171+
licenses {
172+
license {
173+
name = 'The Apache Software License, Version 2.0'
174+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
169175
}
170-
developers {
171-
developer {
172-
id = 'halfhp'
173-
name = 'Nick Fellows'
174-
175-
}
176+
}
177+
developers {
178+
developer {
179+
id = 'halfhp'
180+
name = 'Nick Fellows'
181+
176182
}
177-
scm {
178-
connection = gitUrl
179-
developerConnection = gitUrl
180-
url = gitUrl
183+
}
184+
scm {
185+
connection = gitUrl
186+
developerConnection = gitUrl
187+
url = gitUrl
181188

182-
}
183189
}
184190
}
185191
}
@@ -190,11 +196,11 @@ signing {
190196
def signingKey = System.getenv("SIGNING_KEY")
191197
def signingPassword = System.getenv("SIGNING_PASSWORD")
192198
useInMemoryPgpKeys(signingKey, signingPassword)
193-
sign publishing.publications
199+
sign(publishing.publications)
194200
}
195201

196-
artifacts {
197-
// TODO: get javadoc working again at some point
198-
// archives javadocJar
199-
archives sourcesJar
200-
}
202+
//artifacts {
203+
// // TODO: get javadoc working again at some point
204+
//// archives javadocJar
205+
// archives sourcesJar
206+
//}

0 commit comments

Comments
 (0)