|
4 | 4 |
|
5 | 5 | //apply plugin: 'java-library'
|
6 | 6 | apply plugin: 'maven-publish'
|
7 |
| -apply plugin: 'signing' |
8 | 7 |
|
9 | 8 |
|
10 |
| -def version = '1.5' |
11 |
| -//version = '1.3-SNAPSHOT' |
| 9 | +def versionName = '1.6' |
12 | 10 |
|
13 | 11 | def libraryName = 'AndroidSVG'
|
14 | 12 | def libraryDescription = 'SVG rendering library for Android.'
|
15 | 13 |
|
16 | 14 | def artifactIdAAR = 'androidsvg-aar'
|
17 |
| -def artifactIdJAR = 'androidsvg' |
18 | 15 | def group = 'com.caverock'
|
19 | 16 |
|
20 | 17 | def developerId = 'BigBadaboom'
|
21 | 18 | def developerName = 'Paul LeBeau'
|
22 | 19 | def developerEmail = '[email protected]'
|
23 | 20 |
|
24 |
| -def siteUrl = 'https://github.com/BigBadaboom/androidsvg' |
25 |
| -def gitUrl = 'https://github.com/BigBadaboom/androidsvg.git' |
| 21 | +def siteUrl = 'https://github.com/xmindltd/androidsvg' |
| 22 | +def gitUrl = 'https://github.com/xmindltd/androidsvg.git' |
26 | 23 |
|
27 | 24 | def licenseName = 'The Apache Software License, Version 2.0'
|
28 | 25 | def licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
29 | 26 |
|
30 |
| -def releaseRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" |
31 |
| -def snapshotRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" |
32 |
| - |
33 |
| - |
34 | 27 | publishing {
|
35 | 28 | repositories {
|
36 | 29 | maven {
|
37 |
| - url = version.endsWith('SNAPSHOT') ? snapshotRepoUrl : releaseRepoUrl |
38 |
| - credentials { |
39 |
| - // These are set in ~/.gradle/gradle.properties |
40 |
| - username project.sonatypeUsername |
41 |
| - password project.sonatypePassword |
42 |
| - } |
| 30 | + // change URLs to point to your repos, e.g. http://my.org/repo |
| 31 | + def releasesRepoUrl = layout.buildDirectory.dir('repos/releases') |
| 32 | + def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots') |
| 33 | + url = versionName.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl |
43 | 34 | }
|
44 | 35 | }
|
45 | 36 |
|
46 | 37 | publications {
|
47 |
| - |
48 | 38 | mavenAAR(MavenPublication) {
|
49 |
| - artifactId = artifactIdAAR |
50 | 39 | groupId = group
|
| 40 | + artifactId = artifactIdAAR |
| 41 | + version = versionName |
51 | 42 |
|
52 | 43 | artifact("${buildDir}/outputs/aar/androidsvg-release.aar") {
|
53 | 44 | // wrap in a closure because this task isn't defined 'till
|
54 | 45 | // the android plugin finishes
|
55 | 46 | builtBy { tasks["assembleRelease"] }
|
56 | 47 | }
|
57 |
| - afterEvaluate { |
58 |
| - artifact sourcesJar |
59 |
| - artifact javadocJar |
60 |
| - } |
61 | 48 |
|
62 | 49 | pom {
|
63 | 50 | packaging = 'aar'
|
@@ -87,90 +74,5 @@ publishing {
|
87 | 74 | }
|
88 | 75 | }
|
89 | 76 | }
|
90 |
| - |
91 |
| - mavenJAR(MavenPublication) { |
92 |
| - artifactId = artifactIdJAR |
93 |
| - groupId = group |
94 |
| - |
95 |
| - afterEvaluate { |
96 |
| - artifact libraryJar |
97 |
| - artifact sourcesJar |
98 |
| - artifact javadocJar |
99 |
| - } |
100 |
| - |
101 |
| - pom { |
102 |
| - packaging = 'jar' |
103 |
| - |
104 |
| - name = libraryName |
105 |
| - description = libraryDescription |
106 |
| - url = siteUrl |
107 |
| - |
108 |
| - licenses { |
109 |
| - license { |
110 |
| - name = licenseName |
111 |
| - url = licenseUrl |
112 |
| - distribution = 'repo' |
113 |
| - } |
114 |
| - } |
115 |
| - developers { |
116 |
| - developer { |
117 |
| - id = developerId |
118 |
| - name = developerName |
119 |
| - email = developerEmail |
120 |
| - } |
121 |
| - } |
122 |
| - scm { |
123 |
| - connection = gitUrl |
124 |
| - developerConnection = gitUrl |
125 |
| - url = siteUrl |
126 |
| - } |
127 |
| - } |
128 |
| - } |
129 |
| - } |
130 |
| -} |
131 |
| - |
132 |
| - |
133 |
| -task sourcesJar(type: Jar) { |
134 |
| - from android.sourceSets.main.java.srcDirs |
135 |
| - classifier 'sources' |
136 |
| -} |
137 |
| - |
138 |
| -task javadoc(type: Javadoc) { |
139 |
| - source = android.sourceSets.main.java.srcDirs |
140 |
| - destinationDir = new File("$rootProject.projectDir/doc/") |
141 |
| - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) |
142 |
| - options { |
143 |
| - links "http://docs.oracle.com/javase/7/docs/api/" |
144 |
| - linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference" |
145 |
| - // Replacement stylesheet for javadocs |
146 |
| - stylesheetFile = new File(projectDir, "javadoc-stylesheet.css") |
147 |
| - } |
148 |
| -} |
149 |
| - |
150 |
| -task javadocJar(type: Jar, dependsOn: javadoc) { |
151 |
| - classifier 'javadoc' |
152 |
| - from javadoc.getDestinationDir() |
153 |
| -} |
154 |
| - |
155 |
| -task libraryJar(type: Jar, dependsOn: 'compileReleaseJavaWithJavac') { |
156 |
| - from { |
157 |
| - compileReleaseJavaWithJavac.destinationDir |
158 |
| - } |
159 |
| - |
160 |
| - // Add all dependencies except for android.jar to the fat jar |
161 |
| - from { |
162 |
| - configurations.compile.findAll { |
163 |
| - it.getName() != 'android.jar' && |
164 |
| - !it.getName().startsWith('junit') |
165 |
| - }.collect { |
166 |
| - it.isDirectory() ? it : zipTree(it) |
167 |
| - } |
168 | 77 | }
|
169 |
| - |
170 |
| - archiveName "${artifactIdJAR}-${version}.jar" |
171 |
| -} |
172 |
| - |
173 |
| -signing { |
174 |
| - sign publishing.publications.mavenAAR |
175 |
| - sign publishing.publications.mavenJAR |
176 | 78 | }
|
0 commit comments