merge with 1872-key-agreement

This commit is contained in:
ameba23
2021-03-25 14:55:15 +01:00
93 changed files with 2161 additions and 1811 deletions

View File

@@ -11,9 +11,11 @@ The REST API peer comes as a `jar` file
and needs a Java Runtime Environment (JRE) that supports at least Java 8.
It currently works only on GNU/Linux operating systems.
To build the `jar` file, you can do this:
To build the `jar` file, you need to specify the combination of architecture and platform:
$ ./gradlew --configure-on-demand briar-headless:jar
$ ./gradlew --configure-on-demand briar-headless:x86LinuxJar
$ ./gradlew --configure-on-demand briar-headless:aarch64LinuxJar
$ ./gradlew --configure-on-demand briar-headless:armhfLinuxJar
You can start the peer (and its API server) like this:

View File

@@ -44,18 +44,32 @@ dependencies {
kaptTest "com.google.dagger:dagger-compiler:$daggerVersion"
}
jar {
manifest {
void jarFactory(Jar jarTask, jarArchitecture) {
jarTask.doFirst {
println 'Building ' + jarArchitecture + ' version has started'
}
jarTask.manifest {
attributes(
'Main-Class': 'org.briarproject.briar.headless.MainKt'
)
}
from {
jarTask.setArchiveClassifier(jarArchitecture)
jarTask.from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
doLast() {
{
String[] architectures = ["linux-aarch64", "linux-armhf", "linux-x86_64"]
for (String arch : architectures) {
if (arch != jarArchitecture) {
exclude "obfs4proxy_" + arch + ".zip"
exclude "tor_" + arch + ".zip"
}
}
}
jarTask.with jar
jarTask.doLast {
// Rename the original jar
File jar = project.jar.archivePath
File jar = jarTask.archivePath
String srcPath = jar.toString().replaceFirst('\\.jar$', '.unsorted.jar')
File srcFile = new File(srcPath)
jar.renameTo(srcFile)
@@ -80,9 +94,22 @@ jar {
}
destStream.close()
srcJarFile.close()
println 'Building ' + jarArchitecture + ' version has finished'
}
}
task aarch64LinuxJar(type: Jar) {
jarFactory(it, 'linux-aarch64')
}
task armhfLinuxJar(type: Jar) {
jarFactory(it, 'linux-armhf')
}
task x86LinuxJar(type: Jar) {
jarFactory(it, 'linux-x86_64')
}
// At the moment for non-Android projects we need to explicitly mark the code generated by kapt
// as 'generated source code' for correct highlighting and resolve in IDE.
idea {