-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle
More file actions
110 lines (90 loc) · 2.7 KB
/
build.gradle
File metadata and controls
110 lines (90 loc) · 2.7 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
110
import org.gradle.internal.os.OperatingSystem
plugins {
id "maven-publish"
id "de.undercouch.download" version "5.6.0"
}
// Project Version
ext.pub_version = "2027-0.120-1"
static def get_platform() {
def platform
def os_name = System.getProperty("os.name")
def os_arch = System.getProperty("os.arch")
if (os_arch == 'amd64') {
os_arch = 'x86_64'
} else if (os_arch == 'aarch64' || os_arch == 'arm64') {
os_arch = 'arm64'
}
if (OperatingSystem.current().isWindows()) {
platform = "windows-${os_arch}"
} else if (OperatingSystem.current().isLinux()) {
platform = "linux-${os_arch}"
} else if (OperatingSystem.current().isMacOsX()) {
platform = "osx-universal"
} else {
platform = "${os_name}-${os_arch}"
}
return platform
}
static def get_platform_path(platform) {
if (platform == "linux-arm64") {
return "linux/arm64"
} else if (platform == "linux-x86_64") {
return "linux/x86-64"
} else if (platform == "osx-universal") {
return "osx/universal"
} else if (platform == "windows-x86_64") {
return "windows/x86-64"
} else if (platform == "windows-arm64") {
return "windows/arm64"
} else {
return ""
}
}
ext.platform = get_platform()
if (project.hasProperty('forcecrossbuild')) {
ext.platform = forcecrossbuild
}
ext.platform_path = get_platform_path(ext.platform)
ext.platform_classifier = ext.platform.replaceFirst('-', '').replace('_', '-')
// Get the number of processors available to build.
ext.processors = Runtime.runtime.availableProcessors()
ext.openssl_dir = file("openssl")
ext.openssl_build_dir = file("build/$platform_path/openssl")
ext.openssl_install = file("build/$platform_path/install-openssl")
ext.openssl_arm_build_dir = file("build/arm/openssl")
ext.openssl_arm_install = file("build/arm/install-openssl")
ext.openssl_intel_build_dir = file("build/intel/openssl")
ext.openssl_intel_install = file("build/intel/install-openssl")
ext.libssh_dir = file("libssh-mirror")
ext.libssh_build = file("build/$platform_path/libssh")
task clean {
doLast {
rootDir.eachDir {dir ->
if (dir.name.startsWith("build") || dir.name.startsWith("install"))
delete dir
}
}
}
if (project.platform == "osx-universal") {
apply from: "opensslosx.gradle"
} else {
apply from: "openssl.gradle"
}
apply from: "libssh.gradle"
// Outputs for publishing
def outputs_dir = file("$buildDir/allOutputs")
task copyAllOutputs(type: Copy) {
destinationDir outputs_dir
}
ext.addTaskToCopyAllOutputs = { task ->
copyAllOutputs.dependsOn task
copyAllOutputs.inputs.file task.archiveFile
copyAllOutputs.from task.archiveFile
}
task build {
dependsOn copyAllOutputs
}
apply from: "publish.gradle"
wrapper {
gradleVersion = '9.4.1'
}