I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 18a6dc97 authored by str4d's avatar str4d
Browse files

Use mavenLocal() repository instead of a local file repo

parent fb92d785
No related branches found
No related tags found
No related merge requests found
......@@ -86,24 +86,15 @@ systemProp.socksProxyPort=9150
## Client library
### "Uploading" to a local file repository (to use a local build of the library in a project)
### "Uploading" to the local Maven repository (to use a local build of the library in a project)
1. Add the following line to your `~/.gradle/gradle.properties`:
1. `gradle :client:installArchives`
```
localFileRepoDir=/path/to/local/file/repo
```
2. `gradle :client:uploadArchives`
3. Add the resulting directory to your project as a repository. For Gradle projects, add the following above any existing repositories (so it is checked first):
2. Add the local Maven repository to your project. For Gradle projects, add the following above any existing repositories (so it is checked first):
```
repositories {
flatDir {
name 'fileRepo'
dirs file('/path/to/local/file/repo')
}
mavenLocal()
}
```
......
......@@ -8,17 +8,6 @@ buildscript {
}
}
if (hasProperty('localFileRepoDir')) {
allprojects {
repositories {
flatDir {
name "fileRepo"
dirs file(localFileRepoDir)
}
}
}
}
allprojects {
version = VERSION_NAME
group = GROUP
......
......@@ -45,23 +45,15 @@ android.libraryVariants.all { variant ->
copyClientLibsTask.mustRunAfter ':routerjars:buildClient'
}
if (hasProperty('localFileRepoDir')) {
uploadArchives {
repositories {
add project.repositories.fileRepo
}
apply from: "${project.rootDir}/gradle/maven-push.gradle"
// Remove routerjars from dependencies
afterEvaluate { project ->
def deployer = uploadArchives.repositories.mavenDeployer
deployer*.pom*.whenConfigured { pom ->
pom.setDependencies(pom.dependencies.collect { dep ->
if (dep.groupId != 'i2p.android.base' && dep.artifactId != 'routerjars')
dep
})
}
} else {
apply from: "${project.rootDir}/gradle/maven-push.gradle"
// Remove routerjars from dependencies
afterEvaluate { project ->
def deployer = uploadArchives.repositories.mavenDeployer
deployer*.pom*.whenConfigured { pom ->
pom.setDependencies(pom.dependencies.collect { dep ->
if (dep.groupId != 'i2p.android.base' && dep.artifactId != 'routerjars')
dep
})
}
}
}
\ No newline at end of file
}
......@@ -88,38 +88,42 @@ afterEvaluate { project ->
}
}
task installArchives(type: Upload) {
description "Installs the artifacts to the local Maven repository."
configuration = configurations['archives']
repositories {
mavenDeployer {
pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME
repository url: "file://${System.properties['user.home']}/.m2/repository"
}
}
}
signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
android.libraryVariants.all { variant ->
def androidJavadocs = task("android${variant.name.capitalize()}Javadocs", type: Javadoc) {
source = variant.javaCompile.source
def androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files, androidJar)
options {
links 'http://docs.oracle.com/javase/6/docs/api/'
linksOffline 'http://d.android.com/reference',"${android.sdkDirectory}/docs/reference"
}
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
def androidJavadocsJar = task("android${variant.name.capitalize()}JavadocsJar", type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
def androidSourcesJar = task("android${variant.name.capitalize()}SourcesJar", type: Jar) {
classifier = 'sources'
from variant.javaCompile.source
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment