Skip to content

Commit c9cc88e

Browse files
committed
Publish AAR to local
1 parent 63363fb commit c9cc88e

9 files changed

+52
-133
lines changed

androidsvg/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 31
4+
namespace = "com.caverock.androidsvg"
5+
compileSdk 34
6+
57
defaultConfig {
6-
minSdkVersion 10
7-
targetSdkVersion 31
88

99
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1010
}

androidsvg/publish.gradle

+9-107
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,47 @@
44

55
//apply plugin: 'java-library'
66
apply plugin: 'maven-publish'
7-
apply plugin: 'signing'
87

98

10-
def version = '1.5'
11-
//version = '1.3-SNAPSHOT'
9+
def versionName = '1.6'
1210

1311
def libraryName = 'AndroidSVG'
1412
def libraryDescription = 'SVG rendering library for Android.'
1513

1614
def artifactIdAAR = 'androidsvg-aar'
17-
def artifactIdJAR = 'androidsvg'
1815
def group = 'com.caverock'
1916

2017
def developerId = 'BigBadaboom'
2118
def developerName = 'Paul LeBeau'
2219
def developerEmail = '[email protected]'
2320

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'
2623

2724
def licenseName = 'The Apache Software License, Version 2.0'
2825
def licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
2926

30-
def releaseRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
31-
def snapshotRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
32-
33-
3427
publishing {
3528
repositories {
3629
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
4334
}
4435
}
4536

4637
publications {
47-
4838
mavenAAR(MavenPublication) {
49-
artifactId = artifactIdAAR
5039
groupId = group
40+
artifactId = artifactIdAAR
41+
version = versionName
5142

5243
artifact("${buildDir}/outputs/aar/androidsvg-release.aar") {
5344
// wrap in a closure because this task isn't defined 'till
5445
// the android plugin finishes
5546
builtBy { tasks["assembleRelease"] }
5647
}
57-
afterEvaluate {
58-
artifact sourcesJar
59-
artifact javadocJar
60-
}
6148

6249
pom {
6350
packaging = 'aar'
@@ -87,90 +74,5 @@ publishing {
8774
}
8875
}
8976
}
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-
}
16877
}
169-
170-
archiveName "${artifactIdJAR}-${version}.jar"
171-
}
172-
173-
signing {
174-
sign publishing.publications.mavenAAR
175-
sign publishing.publications.mavenJAR
17678
}

build.gradle

-20
This file was deleted.

build.gradle.kts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
plugins {
3+
alias(libs.plugins.android.application) apply false
4+
alias(libs.plugins.kotlin.android) apply false
5+
}

gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
android.useAndroidX=true
2+
android.defaults.buildfeatures.buildconfig=true

gradle/libs.versions.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[versions]
2+
agp = "8.6.0"
3+
kotlin = "1.9.0"
4+
5+
[libraries]
6+
7+
[plugins]
8+
android-application = { id = "com.android.application", version.ref = "agp" }
9+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
10+
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Sep 02 00:41:47 NZST 2020
1+
#Tue Nov 26 10:03:07 CST 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

settings.gradle

-1
This file was deleted.

settings.gradle.kts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pluginManagement {
2+
repositories {
3+
google {
4+
content {
5+
includeGroupByRegex("com\\.android.*")
6+
includeGroupByRegex("com\\.google.*")
7+
includeGroupByRegex("androidx.*")
8+
}
9+
}
10+
mavenCentral()
11+
gradlePluginPortal()
12+
}
13+
}
14+
dependencyResolutionManagement {
15+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
16+
repositories {
17+
google()
18+
mavenCentral()
19+
}
20+
}
21+
22+
include(":androidsvg")

0 commit comments

Comments
 (0)