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

Skip to content
Snippets Groups Projects
Commit 543fb51d authored by str4d's avatar str4d
Browse files

Simplify adding client library to a local flatDir repo

parent 4328db19
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,43 @@ systemProp.socksProxyPort=9150 ...@@ -84,6 +84,43 @@ systemProp.socksProxyPort=9150
2. `gradle assembleRelease` 2. `gradle assembleRelease`
## Client library
### "Uploading" to a local file repository (to use a local build of the library in a project)
1. Add the following line to your `~/.gradle/gradle.properties`:
```
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):
```
repositories {
flatDir {
name 'fileRepo'
dirs file('/path/to/local/file/repo')
}
}
```
### Uploading to Maven Central via Sonatype OSSRH
1. Add the following lines to your `~/.gradle/gradle.properties` (filling in the blanks):
```
signing.keyId=
signing.password=
signing.secretKeyRingFile=/path/to/secring.gpg
ossrhUsername=
ossrhPassword=
```
2. `gradle :client:uploadArchives`
### Commands from the old build instructions that might be useful ### Commands from the old build instructions that might be useful
``` ```
......
...@@ -8,6 +8,17 @@ buildscript { ...@@ -8,6 +8,17 @@ buildscript {
} }
} }
if (hasProperty('localFileRepoDir')) {
allprojects {
repositories {
flatDir {
name "fileRepo"
dirs file(localFileRepoDir)
}
}
}
}
allprojects { allprojects {
version = VERSION_NAME version = VERSION_NAME
group = GROUP group = GROUP
......
...@@ -34,15 +34,23 @@ android.libraryVariants.all { variant -> ...@@ -34,15 +34,23 @@ android.libraryVariants.all { variant ->
copyClientLibsTask.mustRunAfter ':routerjars:buildClient' copyClientLibsTask.mustRunAfter ':routerjars:buildClient'
} }
apply from: "${project.rootDir}/gradle/maven-push.gradle" if (hasProperty('localFileRepoDir')) {
uploadArchives {
repositories {
add project.repositories.fileRepo
}
}
} else {
apply from: "${project.rootDir}/gradle/maven-push.gradle"
// Remove routerjars from dependencies // Remove routerjars from dependencies
afterEvaluate { project -> afterEvaluate { project ->
def deployer = uploadArchives.repositories.mavenDeployer def deployer = uploadArchives.repositories.mavenDeployer
deployer*.pom*.whenConfigured { pom -> deployer*.pom*.whenConfigured { pom ->
pom.setDependencies(pom.dependencies.collect { dep -> pom.setDependencies(pom.dependencies.collect { dep ->
if (dep.groupId != 'i2p.android.base' && dep.artifactId != 'routerjars') if (dep.groupId != 'i2p.android.base' && dep.artifactId != 'routerjars')
dep dep
}) })
}
} }
} }
\ 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