-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
64 lines (53 loc) · 1.19 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
plugins {
id 'java-library'
id 'maven-publish'
}
def ENV = System.getenv()
version = "0.0.4" + (ENV.GITHUB_ACTIONS ? "" : "+local")
group = project.maven_group
base {
archivesName = project.archives_base_name
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
evaluationDependsOn(":windows")
def archs = [
"aarch64",
"x86_64"
]
// Set to "Debug" for debug builds
def config = "Release"
def collectPackage = tasks.register("collectDlls", Sync) {
archs.forEach { arch ->
from(fileTree("windows/.build/${arch}-unknown-windows-msvc/${config.toLowerCase()}/package")) {
into "fabric-sandbox/${arch}"
}
}
into layout.buildDirectory.dir("package")
dependsOn project(":windows").tasks.named("package" + config)
}
sourceSets.main.resources.srcDir collectPackage
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java
}
}
repositories {
if (ENV.MAVEN_URL) {
maven {
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
}
}