diff options
author | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2023-07-11 07:11:16 +0000 |
---|---|---|
committer | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2023-07-11 07:11:16 +0000 |
commit | f9b0ce84cd3956ad169cb312c52398f7dd10d2fa (patch) | |
tree | d1057257791c1a0a9d7e3d7e369380f0438391fb /ipscrambling/exportdependencies | |
parent | 4dcfe5eb84142df16f7b8c5431b4afeb2a28cbc2 (diff) | |
parent | 921756bb2f3bb7891386f5aac551fe775d454a78 (diff) |
Merge branch '2-integrate_ipscrambling_module' into 'main'
2: integrate ipscrambling module in git repos and update dependencies
See merge request e/os/advanced-privacy!137
Diffstat (limited to 'ipscrambling/exportdependencies')
-rw-r--r-- | ipscrambling/exportdependencies/pom.xml | 24 | ||||
-rw-r--r-- | ipscrambling/exportdependencies/publish.gradle | 52 | ||||
-rw-r--r-- | ipscrambling/exportdependencies/update_dependencies.md | 43 |
3 files changed, 119 insertions, 0 deletions
diff --git a/ipscrambling/exportdependencies/pom.xml b/ipscrambling/exportdependencies/pom.xml new file mode 100644 index 0000000..be28747 --- /dev/null +++ b/ipscrambling/exportdependencies/pom.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>foundation.e</groupId> + <artifactId>orbotservice</artifactId> + <version>orbot-16.6.3-1</version> + + <description></description> + + <properties> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + <packaging>aar</packaging> + <file>OrbotLib.aar</file> + </properties> + + <repositories> + <repository> + <id>gitlab-e-maven</id> + <url>https://gitlab.e.foundation/api/v4/projects/1063/packages/maven</url> + </repository> + </repositories> +</project> diff --git a/ipscrambling/exportdependencies/publish.gradle b/ipscrambling/exportdependencies/publish.gradle new file mode 100644 index 0000000..657ce22 --- /dev/null +++ b/ipscrambling/exportdependencies/publish.gradle @@ -0,0 +1,52 @@ +apply plugin: 'maven-publish' + +publishing { + publications { + maven(MavenPublication) { + groupId 'foundation.e' + artifactId 'orbotservice' + version versions.orbot_service + artifact "$buildDir/outputs/aar/orbotservice-release.aar" + + pom.withXml { + def dependenciesNode = asNode().appendNode('dependencies') + configurations.implementation.allDependencies.each { dependency -> + if (dependency.name != 'unspecified') { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', dependency.group) + dependencyNode.appendNode('artifactId', dependency.name) + dependencyNode.appendNode('version', dependency.version) + } + } + } + + repositories { + def ciJobToken = System.getenv("CI_JOB_TOKEN") + def ciApiV4Url = System.getenv("CI_API_V4_URL") + if (ciJobToken != null) { + maven { + url "${ciApiV4Url}/projects/1063/packages/maven" + credentials(HttpHeaderCredentials) { + name = 'Job-Token' + value = ciJobToken + } + authentication { + header(HttpHeaderAuthentication) + } + } + } else { + maven { + url "https://gitlab.e.foundation/api/v4/projects/1063/packages/maven" + credentials(HttpHeaderCredentials) { + name = "Private-Token" + value = gitLabPrivateToken + } + authentication { + header(HttpHeaderAuthentication) + } + } + } + } + } + } +}
\ No newline at end of file diff --git a/ipscrambling/exportdependencies/update_dependencies.md b/ipscrambling/exportdependencies/update_dependencies.md new file mode 100644 index 0000000..32ef58d --- /dev/null +++ b/ipscrambling/exportdependencies/update_dependencies.md @@ -0,0 +1,43 @@ +A few orbot dependencies are added directly through the /libs directory, because remotely available version are outdated. We can't embed .aar or .jar into the orbotservice.aar (as any aar), so we have to expose this dependencies in the gitlab repository. + +To do that we use the mn deploy:deploy-file command ; and also the mvn install:install-file command to deploy in local maven repository for development. + +1. Update the orbot_service version in + * exportdependencies/pom.xml file + * dependencies.gradle +2. For each dependencies in orbot/libs, update or prepare an entry in dependecies.gradle, using groupId=foundation.e ; version orbot_service, and an approprioate artifactId . +3. For each dependencies in orbot/libs, run with appropriate PATH and ARTIFACTID : + +mvn install:install-file \ +-DartifactId=[ARTIFACTID] \ +-Dpackaging=aar \ +-Dfile=[PATH] + +4. Later, when isvalidated, deploy to gitlab repository: + +mvn deploy:deploy-file \ +-DrepositoryId=gitlab-e-maven \ +-Durl=https://gitlab.e.foundation/api/v4/projects/1063/packages/maven \ +-DartifactId=[ARTIFACTID] \ +-Dpackaging=aar \ +-Dfile=[PATH] + +example, for tor-android-binary +step 2: +"info.guardianproject:tor-android:$versions.tor_android" -> "foundation.e:tor-android:$versions.orbot_service", + +step 3: + +mvn install:install-file \ +-DartifactId=tor-android \ +-Dpackaging=aar \ +-Dfile="../../orbot/libs/tor-android-binary-release.aar + +step 4 : + +mvn deploy:deploy-file \ +-DrepositoryId=gitlab-e-maven \ +-Durl=https://gitlab.e.foundation/api/v4/projects/1063/packages/maven \ +-DartifactId=tor-android \ +-Dpackaging=aar \ +-Dfile="../../orbot/libs/tor-android-binary-release.aar |