-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle
64 lines (50 loc) · 1.83 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
allprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.wizzardo'
version = '0.3.5-SNAPSHOT'
javadoc {
options.tags = ["author:"]
}
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
}
ext {
toolsVersion = '0.24-SNAPSHOT'
descriptionString = 'Event-based socket server, which uses epoll'
cWorkDir = 'src/main/c/com/wizzardo/epoll'
}
apply from: 'gradle/sonatype.gradle'
dependencies {
implementation "com.wizzardo.tools:tools-io:$toolsVersion"
implementation "com.wizzardo.tools:tools-reflection:$toolsVersion"
implementation project(':natives:x32')
implementation project(':natives:x64')
implementation project(':natives:aarch64')
testImplementation 'junit:junit:4.12'
testImplementation "com.wizzardo.tools:tools:$toolsVersion"
}
jar {
dependsOn 'compileNatives'
}
task compileNatives(type: Exec, dependsOn: ['prepareCoreHeaders', 'prepareSSLHeaders']) {
doLast {
def proc = "./build_natives.sh".execute([], new File(project.projectDir.absolutePath))
proc.waitForProcessOutput(System.out, System.err)
}
commandLine 'ls', 'build'
}
task prepareCoreHeaders(type: Exec, dependsOn: ['compileJava']) {
doFirst {
sourceSets.main.runtimeClasspath.each { println it }
}
commandLine 'javac', '-classpath', 'build/classes/java/main:' + sourceSets.main.runtimeClasspath.getAsPath(), '-h', cWorkDir, 'src/main/java/com/wizzardo/epoll/EpollCore.java'
}
task prepareSSLHeaders(type: Exec, dependsOn: ['compileJava']) {
commandLine 'javac', '-classpath', 'build/classes/java/main:' + sourceSets.main.runtimeClasspath.getAsPath(), '-h', cWorkDir, 'src/main/java/com/wizzardo/epoll/EpollSSL.java'
}