Newer
Older
plugins {
id 'application'
id 'idea'
id 'org.jetbrains.kotlin.jvm'
id 'org.jetbrains.kotlin.kapt'
id "org.jlleitschuh.gradle.ktlint" version "$ktlint_plugin_version"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation project(path: ':mailbox-core', configuration: 'default')
implementation "ch.qos.logback:logback-classic:1.2.5"
implementation 'com.github.ajalt:clikt:2.2.0'
def jna_version = '5.8.0'
implementation "net.java.dev.jna:jna:$jna_version"
implementation "net.java.dev.jna:jna-platform:$jna_version"
tor "org.briarproject:tor:$tor_version"
tor "org.briarproject:obfs4proxy:$obfs4_version@zip"
implementation "com.google.dagger:hilt-core:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version"
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junit_version"
testImplementation "io.mockk:mockk:$mockk_version"
}
application {
mainClassName = 'org.briarproject.mailbox.cli.MainKt'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
apply from: "${rootProject.rootDir}/gradle/ktlint.gradle"
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// 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 {
module {
sourceDirs += file('build/generated/source/kapt/main')
testSourceDirs += file('build/generated/source/kapt/test')
generatedSourceDirs += file('build/generated/source/kapt/main')
}
}
def torBinariesDir = 'src/main/resources'
task cleanTorBinaries {
doLast {
delete fileTree(torBinariesDir) { include '*.zip' }
}
}
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) {
systemProperty 'java.library.path', 'libs'
}