-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathbuild.gradle
67 lines (53 loc) · 1.48 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
65
66
// Establish version and status
ext {
githubProjectName = rootProject.name // Change if github project name is not the same as the root project's name
}
buildscript {
repositories {
mavenLocal()
mavenCentral() // maven { url 'http://jcenter.bintray.com' }
}
apply from: file('gradle/buildscript.gradle'), to: buildscript
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
apply from: file('gradle/convention.gradle')
apply from: file('gradle/maven.gradle')
// apply from: file('gradle/check.gradle')
// apply from: file('gradle/license.gradle')
// apply from: file('gradle/release.gradle')
apply plugin: 'c'
model {
platforms {
x86 {
architecture "x86"
}
x64 {
architecture "x86_64"
}
}
components {
perfj(NativeLibrarySpec) {
// targetPlatform "x86"
// targetPlatform "x64"
binaries.withType(SharedLibraryBinarySpec) {
if (targetPlatform.operatingSystem.linux) {
cCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include"
cCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/linux"
sharedLibraryFile file("${buildDir}/classes/main/info/minzhou/perfj/native/libperfj.so")
}
}
binaries.withType(StaticLibraryBinarySpec) {
buildable false
}
}
}
}
jar.dependsOn 'perfjSharedLibrary'
dependencies {
provided files("${org.gradle.internal.jvm.Jvm.current().javaHome}/lib/tools.jar")
}