mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 22:59:54 +01:00
Convert tor to regular dependencies
This commit is contained in:
@@ -7,10 +7,6 @@ apply plugin: 'witness'
|
|||||||
apply from: 'witness.gradle'
|
apply from: 'witness.gradle'
|
||||||
apply from: '../dagger.gradle'
|
apply from: '../dagger.gradle'
|
||||||
|
|
||||||
configurations {
|
|
||||||
tor
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':bramble-core')
|
implementation project(':bramble-core')
|
||||||
|
|
||||||
@@ -19,12 +15,9 @@ dependencies {
|
|||||||
implementation "net.java.dev.jna:jna:$jna_version"
|
implementation "net.java.dev.jna:jna:$jna_version"
|
||||||
implementation "net.java.dev.jna:jna-platform:$jna_version"
|
implementation "net.java.dev.jna:jna-platform:$jna_version"
|
||||||
|
|
||||||
tor "org.briarproject:tor-linux:$tor_version"
|
testImplementation "org.briarproject:tor-linux:$tor_version"
|
||||||
tor "org.briarproject:tor-windows:$tor_version"
|
testImplementation "org.briarproject:obfs4proxy-linux:$obfs4proxy_version"
|
||||||
tor "org.briarproject:obfs4proxy-linux:$obfs4proxy_version"
|
testImplementation "org.briarproject:snowflake-linux:$snowflake_version"
|
||||||
tor "org.briarproject:obfs4proxy-windows:$obfs4proxy_version"
|
|
||||||
tor "org.briarproject:snowflake-linux:$snowflake_version"
|
|
||||||
tor "org.briarproject:snowflake-windows:$snowflake_version"
|
|
||||||
|
|
||||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
||||||
|
|
||||||
@@ -39,31 +32,6 @@ dependencies {
|
|||||||
testAnnotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
testAnnotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
def torBinariesDir = 'src/main/resources'
|
|
||||||
|
|
||||||
task cleanTorBinaries {
|
|
||||||
doLast {
|
|
||||||
delete fileTree(torBinariesDir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
clean.dependsOn cleanTorBinaries
|
|
||||||
|
|
||||||
task unpackTorBinaries {
|
|
||||||
doLast {
|
|
||||||
copy {
|
|
||||||
from configurations.tor.collect { zipTree(it) }
|
|
||||||
into torBinariesDir
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dependsOn cleanTorBinaries
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources {
|
|
||||||
inputs.dir torBinariesDir
|
|
||||||
dependsOn unpackTorBinaries
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType(Test) {
|
tasks.withType(Test) {
|
||||||
systemProperty 'java.library.path', 'libs'
|
systemProperty 'java.library.path', 'libs'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package org.briarproject.bramble.test;
|
||||||
|
|
||||||
|
import org.briarproject.bramble.util.OsUtils;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
|
public class TestResources {
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void isRunningOnLinux() {
|
||||||
|
assumeTrue(OsUtils.isLinux());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canReadTorLinux() {
|
||||||
|
InputStream input = Thread.currentThread().getContextClassLoader()
|
||||||
|
.getResourceAsStream("x86_64/tor");
|
||||||
|
assertNotNull(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canReadObfs4ProxyLinux() {
|
||||||
|
InputStream input = Thread.currentThread().getContextClassLoader()
|
||||||
|
.getResourceAsStream("x86_64/obfs4proxy");
|
||||||
|
assertNotNull(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canReadSnowflakeLinux() {
|
||||||
|
InputStream input = Thread.currentThread().getContextClassLoader()
|
||||||
|
.getResourceAsStream("x86_64/snowflake");
|
||||||
|
assertNotNull(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -27,11 +27,8 @@ dependencyVerification {
|
|||||||
'net.ltgt.gradle.incap:incap:0.2:incap-0.2.jar:b625b9806b0f1e4bc7a2e3457119488de3cd57ea20feedd513db070a573a4ffd',
|
'net.ltgt.gradle.incap:incap:0.2:incap-0.2.jar:b625b9806b0f1e4bc7a2e3457119488de3cd57ea20feedd513db070a573a4ffd',
|
||||||
'org.apache-extras.beanshell:bsh:2.0b6:bsh-2.0b6.jar:a17955976070c0573235ee662f2794a78082758b61accffce8d3f8aedcd91047',
|
'org.apache-extras.beanshell:bsh:2.0b6:bsh-2.0b6.jar:a17955976070c0573235ee662f2794a78082758b61accffce8d3f8aedcd91047',
|
||||||
'org.briarproject:obfs4proxy-linux:0.0.14-tor2:obfs4proxy-linux-0.0.14-tor2.jar:bb2431092b5ad998ad620b0223e725c0f7e43f1b02af2f097a2544edc1fd9738',
|
'org.briarproject:obfs4proxy-linux:0.0.14-tor2:obfs4proxy-linux-0.0.14-tor2.jar:bb2431092b5ad998ad620b0223e725c0f7e43f1b02af2f097a2544edc1fd9738',
|
||||||
'org.briarproject:obfs4proxy-windows:0.0.14-tor2:obfs4proxy-windows-0.0.14-tor2.jar:b5fbd00a8c35ccf095b265370752390e4cd46055331049c4dfcc236dc9c650ac',
|
|
||||||
'org.briarproject:snowflake-linux:2.5.1:snowflake-linux-2.5.1.jar:edc807dcb7758365970d95525e4749349a27f462d0e2df6505ad1ca65fb296d2',
|
'org.briarproject:snowflake-linux:2.5.1:snowflake-linux-2.5.1.jar:edc807dcb7758365970d95525e4749349a27f462d0e2df6505ad1ca65fb296d2',
|
||||||
'org.briarproject:snowflake-windows:2.5.1:snowflake-windows-2.5.1.jar:700ec9c68dc033f544daa4ca3547c89e523aed66500cf4b3ac51fe017c51e7be',
|
|
||||||
'org.briarproject:tor-linux:0.4.7.13-1:tor-linux-0.4.7.13-1.jar:652f3d8eaa6ff2258e991a2b8238f48fff86323877527e7c8bb125e015af0f18',
|
'org.briarproject:tor-linux:0.4.7.13-1:tor-linux-0.4.7.13-1.jar:652f3d8eaa6ff2258e991a2b8238f48fff86323877527e7c8bb125e015af0f18',
|
||||||
'org.briarproject:tor-windows:0.4.7.13-1:tor-windows-0.4.7.13-1.jar:ad88b9ab77c3ab14109ee75094b085e61a6da3a6530fd1906d663e560af6b2e7',
|
|
||||||
'org.checkerframework:checker-compat-qual:2.5.5:checker-compat-qual-2.5.5.jar:11d134b245e9cacc474514d2d66b5b8618f8039a1465cdc55bbc0b34e0008b7a',
|
'org.checkerframework:checker-compat-qual:2.5.5:checker-compat-qual-2.5.5.jar:11d134b245e9cacc474514d2d66b5b8618f8039a1465cdc55bbc0b34e0008b7a',
|
||||||
'org.checkerframework:checker-qual:3.12.0:checker-qual-3.12.0.jar:ff10785ac2a357ec5de9c293cb982a2cbb605c0309ea4cc1cb9b9bc6dbe7f3cb',
|
'org.checkerframework:checker-qual:3.12.0:checker-qual-3.12.0.jar:ff10785ac2a357ec5de9c293cb982a2cbb605c0309ea4cc1cb9b9bc6dbe7f3cb',
|
||||||
'org.hamcrest:hamcrest-core:2.1:hamcrest-core-2.1.jar:e09109e54a289d88506b9bfec987ddd199f4217c9464132668351b9a4f00bee9',
|
'org.hamcrest:hamcrest-core:2.1:hamcrest-core-2.1.jar:e09109e54a289d88506b9bfec987ddd199f4217c9464132668351b9a4f00bee9',
|
||||||
|
|||||||
@@ -13,6 +13,15 @@ plugins {
|
|||||||
}
|
}
|
||||||
apply from: 'witness.gradle'
|
apply from: 'witness.gradle'
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
windows {
|
||||||
|
extendsFrom runtimeClasspath
|
||||||
|
}
|
||||||
|
linux {
|
||||||
|
extendsFrom runtimeClasspath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
@@ -21,6 +30,14 @@ dependencies {
|
|||||||
implementation project(':bramble-java')
|
implementation project(':bramble-java')
|
||||||
implementation project(':briar-core')
|
implementation project(':briar-core')
|
||||||
|
|
||||||
|
linux "org.briarproject:tor-linux:$tor_version"
|
||||||
|
linux "org.briarproject:obfs4proxy-linux:$obfs4proxy_version"
|
||||||
|
linux "org.briarproject:snowflake-linux:$snowflake_version"
|
||||||
|
|
||||||
|
windows "org.briarproject:tor-windows:$tor_version"
|
||||||
|
windows "org.briarproject:obfs4proxy-windows:$obfs4proxy_version"
|
||||||
|
windows "org.briarproject:snowflake-windows:$snowflake_version"
|
||||||
|
|
||||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10'
|
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10'
|
||||||
implementation 'io.javalin:javalin:3.5.0'
|
implementation 'io.javalin:javalin:3.5.0'
|
||||||
implementation 'org.slf4j:slf4j-simple:1.7.30'
|
implementation 'org.slf4j:slf4j-simple:1.7.30'
|
||||||
@@ -47,7 +64,8 @@ dependencies {
|
|||||||
kaptTest "com.google.dagger:dagger-compiler:$dagger_version"
|
kaptTest "com.google.dagger:dagger-compiler:$dagger_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
void jarFactory(Jar jarTask, jarArchitecture) {
|
void jarFactory(Jar jarTask, os, architecture, configuration) {
|
||||||
|
def jarArchitecture = os + "-" + architecture
|
||||||
jarTask.dependsOn(
|
jarTask.dependsOn(
|
||||||
':bramble-api:jar',
|
':bramble-api:jar',
|
||||||
':bramble-core:jar',
|
':bramble-core:jar',
|
||||||
@@ -66,21 +84,22 @@ void jarFactory(Jar jarTask, jarArchitecture) {
|
|||||||
}
|
}
|
||||||
jarTask.setArchiveClassifier(jarArchitecture)
|
jarTask.setArchiveClassifier(jarArchitecture)
|
||||||
jarTask.from {
|
jarTask.from {
|
||||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
configuration.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
it.duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
it.duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
||||||
String[] architectures = [
|
if (os == "linux") {
|
||||||
"linux-aarch64",
|
String[] architectures = [
|
||||||
"linux-armhf",
|
"aarch64",
|
||||||
"linux-x86_64",
|
"armhf",
|
||||||
"windows-x86_64"
|
"x86_64",
|
||||||
]
|
]
|
||||||
for (String arch : architectures) {
|
for (String arch : architectures) {
|
||||||
if (arch != jarArchitecture) {
|
if (arch != architecture) {
|
||||||
exclude "obfs4proxy_" + arch + ".zip"
|
exclude arch + "/obfs4proxy"
|
||||||
exclude "tor_" + arch + ".zip"
|
exclude arch + "/tor"
|
||||||
exclude "snowflake_" + arch + ".zip"
|
exclude arch + "/snowflake"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA'
|
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA'
|
||||||
@@ -118,19 +137,19 @@ void jarFactory(Jar jarTask, jarArchitecture) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task aarch64LinuxJar(type: Jar) {
|
task aarch64LinuxJar(type: Jar) {
|
||||||
jarFactory(it, 'linux-aarch64')
|
jarFactory(it, 'linux', 'aarch64', configurations.linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
task armhfLinuxJar(type: Jar) {
|
task armhfLinuxJar(type: Jar) {
|
||||||
jarFactory(it, 'linux-armhf')
|
jarFactory(it, 'linux', 'armhf', configurations.linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
task x86LinuxJar(type: Jar) {
|
task x86LinuxJar(type: Jar) {
|
||||||
jarFactory(it, 'linux-x86_64')
|
jarFactory(it, 'linux', 'x86_64', configurations.linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
task windowsJar(type: Jar) {
|
task windowsJar(type: Jar) {
|
||||||
jarFactory(it, 'windows-x86_64')
|
jarFactory(it, 'windows', 'x86_64', configurations.windows)
|
||||||
}
|
}
|
||||||
|
|
||||||
task linuxJars {
|
task linuxJars {
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ dependencyVerification {
|
|||||||
'net.ltgt.gradle.incap:incap:0.2:incap-0.2.jar:b625b9806b0f1e4bc7a2e3457119488de3cd57ea20feedd513db070a573a4ffd',
|
'net.ltgt.gradle.incap:incap:0.2:incap-0.2.jar:b625b9806b0f1e4bc7a2e3457119488de3cd57ea20feedd513db070a573a4ffd',
|
||||||
'org.apiguardian:apiguardian-api:1.1.0:apiguardian-api-1.1.0.jar:a9aae9ff8ae3e17a2a18f79175e82b16267c246fbbd3ca9dfbbb290b08dcfdd4',
|
'org.apiguardian:apiguardian-api:1.1.0:apiguardian-api-1.1.0.jar:a9aae9ff8ae3e17a2a18f79175e82b16267c246fbbd3ca9dfbbb290b08dcfdd4',
|
||||||
'org.bouncycastle:bcprov-jdk15to18:1.71:bcprov-jdk15to18-1.71.jar:143aaa4a40edd5fc2a18db7900059f6c16f4d931b94b94b20f7e2238e6662886',
|
'org.bouncycastle:bcprov-jdk15to18:1.71:bcprov-jdk15to18-1.71.jar:143aaa4a40edd5fc2a18db7900059f6c16f4d931b94b94b20f7e2238e6662886',
|
||||||
|
'org.briarproject:obfs4proxy-linux:0.0.14-tor2:obfs4proxy-linux-0.0.14-tor2.jar:bb2431092b5ad998ad620b0223e725c0f7e43f1b02af2f097a2544edc1fd9738',
|
||||||
|
'org.briarproject:obfs4proxy-windows:0.0.14-tor2:obfs4proxy-windows-0.0.14-tor2.jar:b5fbd00a8c35ccf095b265370752390e4cd46055331049c4dfcc236dc9c650ac',
|
||||||
|
'org.briarproject:snowflake-linux:2.5.1:snowflake-linux-2.5.1.jar:edc807dcb7758365970d95525e4749349a27f462d0e2df6505ad1ca65fb296d2',
|
||||||
|
'org.briarproject:snowflake-windows:2.5.1:snowflake-windows-2.5.1.jar:700ec9c68dc033f544daa4ca3547c89e523aed66500cf4b3ac51fe017c51e7be',
|
||||||
|
'org.briarproject:tor-linux:0.4.7.13-1:tor-linux-0.4.7.13-1.jar:652f3d8eaa6ff2258e991a2b8238f48fff86323877527e7c8bb125e015af0f18',
|
||||||
|
'org.briarproject:tor-windows:0.4.7.13-1:tor-windows-0.4.7.13-1.jar:ad88b9ab77c3ab14109ee75094b085e61a6da3a6530fd1906d663e560af6b2e7',
|
||||||
'org.checkerframework:checker-compat-qual:2.5.5:checker-compat-qual-2.5.5.jar:11d134b245e9cacc474514d2d66b5b8618f8039a1465cdc55bbc0b34e0008b7a',
|
'org.checkerframework:checker-compat-qual:2.5.5:checker-compat-qual-2.5.5.jar:11d134b245e9cacc474514d2d66b5b8618f8039a1465cdc55bbc0b34e0008b7a',
|
||||||
'org.checkerframework:checker-qual:3.12.0:checker-qual-3.12.0.jar:ff10785ac2a357ec5de9c293cb982a2cbb605c0309ea4cc1cb9b9bc6dbe7f3cb',
|
'org.checkerframework:checker-qual:3.12.0:checker-qual-3.12.0.jar:ff10785ac2a357ec5de9c293cb982a2cbb605c0309ea4cc1cb9b9bc6dbe7f3cb',
|
||||||
'org.eclipse.jetty.websocket:websocket-api:9.4.20.v20190813:websocket-api-9.4.20.v20190813.jar:779a29060cc17bdeeeba147efc884ebff972cfff93dad2d37b11c93f95d4f67b',
|
'org.eclipse.jetty.websocket:websocket-api:9.4.20.v20190813:websocket-api-9.4.20.v20190813.jar:779a29060cc17bdeeeba147efc884ebff972cfff93dad2d37b11c93f95d4f67b',
|
||||||
|
|||||||
Reference in New Issue
Block a user