-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
109 lines (95 loc) · 3.85 KB
/
build.gradle
File metadata and controls
109 lines (95 loc) · 3.85 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
description 'JNI Java library (cbc-java) for COIN-OR CBC Solver'
ext {
slf4j_version = '1.7.36'
}
wrapper {
gradleVersion = "8.12"
}
allprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
sourceCompatibility = 11
targetCompatibility = 11
group 'de.unijena.bioinf.cbc-java'
version '2.10.12.2' //corresponds tp cbc version with additional build number for changes of the packaging.
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://gitlab.com/api/v4/groups/bright-giant/-/packages/maven"
}
}
println System.getProperty("os.arch").toLowerCase();
}
publishing {
publications {
javaCbc(MavenPublication) {
artifactId 'cbc-java'
from components.java
}
javaCbcJni(MavenPublication) {
artifactId 'cbc-java-jni'
subprojects.findAll { it.name.contains('-jni-') }.each { artifact(it.tasks.findByName("jar")) }
println("JNI: $artifacts")
}
javaCbcNative(MavenPublication) {
artifactId 'cbc-java-native'
subprojects.findAll { it.name.contains('-native-') }.each { artifact(it.tasks.findByName("jar")) }
println("NATIVE: $artifacts")
}
}
repositories {
maven {
name = "GitLab"
if (System.getenv("CI_JOB_TOKEN") != null) {
println("Using ENV based JOB Token auth for mavenPublish!")
// local registry
// url = "${System.getenv('CI_API_V4_URL')}/projects/${System.getenv('CI_PROJECT_ID')}/packages/maven"
//central public registry
url = System.getenv('PUBLIC_REGISTRY_URL')
credentials(HttpHeaderCredentials) {
name = "Job-Token"
value = System.getenv("CI_JOB_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
//Use user based token from gradle.properties file
} else {
println("Using gradle.properties based User Token auth for mavenPublish!")
url = project.findProperty("java-cbc.build.artifactory.url") as String
credentials(PasswordCredentials) {
username = project.findProperty("java-cbc.build.artifactory.username") as String
password = project.findProperty("java-cbc.build.artifactory.token") as String
// the variable resides in $GRADLE_USER_HOME/gradle.properties
// https://docs.gradle.org/current/userguide/directory_layout.html#dir:gradle_user_home
}
authentication {
basic(BasicAuthentication)
}
}
}
}
}
dependencies {
//all sub projects as dependency
implementation 'cz.adamh:native-utils:1.3.1'
implementation "org.slf4j:slf4j-api:$slf4j_version"
testImplementation project('cbc-java-jni-linux-x86-64')
testImplementation project('cbc-java-native-linux-x86-64')
testImplementation project('cbc-java-jni-linux-arm64')
testImplementation project('cbc-java-native-linux-arm64')
testImplementation project('cbc-java-jni-win-x86-64')
testImplementation project('cbc-java-native-win-x86-64')
testImplementation project('cbc-java-jni-mac-x86-64')
testImplementation project('cbc-java-native-mac-x86-64')
testImplementation project('cbc-java-jni-mac-arm64')
testImplementation project('cbc-java-native-mac-arm64')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testImplementation("org.junit.vintage:junit-vintage-engine:5.10.0")
testImplementation('org.junit.jupiter:junit-jupiter-params:5.10.0')
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
}
test {
useJUnitPlatform()
}