-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
166 lines (137 loc) · 4.76 KB
/
Copy pathbuild.gradle
File metadata and controls
166 lines (137 loc) · 4.76 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
plugins {
id 'java-library'
id 'maven-publish'
}
allprojects {
group = 'com.aprismlab'
version = project.property('aprismjdkVersion')
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply from: "${rootProject.projectDir}/publishing.gradle"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
}
tasks.withType(Test) {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed'
exceptionFormat 'full'
showStandardStreams = false
}
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
options.addStringOption('Xdoclint:none', '-quiet')
}
dependencies {
testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junitPlatformVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoVersion}"
}
}
// Root project tasks
tasks.register('buildAll') {
dependsOn subprojects.collect { it.tasks.named('build') }
group = 'build'
description = 'Assembles and tests all AprismJDK modules'
}
tasks.register('testAll') {
dependsOn subprojects.collect { it.tasks.withType(Test) }
group = 'verification'
description = 'Runs all test suites'
}
// OpenJDK build tasks
task buildOpenJDK(type: Exec) {
group = 'build'
description = 'Build OpenJDK with Aprism customizations'
def isWindows = System.getProperty('os.name').toLowerCase().contains('windows')
if (isWindows) {
commandLine 'powershell', '-ExecutionPolicy', 'Bypass', '-File',
"${projectDir}/scripts/build-openjdk.ps1"
} else {
commandLine 'bash', "${projectDir}/scripts/build-openjdk.sh"
}
// Set working directory
workingDir projectDir
doFirst {
println "Starting OpenJDK build for AprismJDK..."
}
doLast {
println "OpenJDK build completed successfully"
}
}
task verifyOpenJDK {
group = 'verification'
description = 'Verify OpenJDK build output'
dependsOn buildOpenJDK
doLast {
def buildDir = file("${projectDir}/openjdk-25/build")
if (!buildDir.exists()) {
throw new GradleException("OpenJDK build directory not found")
}
// Find the build output directory
def imagesDirs = buildDir.listFiles({ dir, name ->
name.contains('server') && new File(dir, name + '/images').exists()
} as FilenameFilter)
if (imagesDirs == null || imagesDirs.length == 0) {
throw new GradleException("No OpenJDK build output found")
}
def imagesDir = new File(imagesDirs[0], 'images')
def jdkDir = new File(imagesDir, 'jdk')
def jreDir = new File(imagesDir, 'jre')
println "OpenJDK Build Verification:"
println " JDK: ${jdkDir.exists() ? 'PRESENT' : 'MISSING'} - ${jdkDir}"
println " JRE: ${jreDir.exists() ? 'PRESENT' : 'MISSING'} - ${jreDir}"
if (jdkDir.exists()) {
def javaCmd = new File(jdkDir, 'bin/java')
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
javaCmd = new File(jdkDir, 'bin/java.exe')
}
if (javaCmd.exists()) {
println "\nJava version:"
exec {
commandLine javaCmd.absolutePath, '-version'
standardOutput = System.out
errorOutput = System.err
}
}
}
}
}
// Package task for creating distribution artifacts
task packageJDK {
group = 'distribution'
description = 'Package full JDK distribution (requires OpenJDK build)'
dependsOn buildOpenJDK
doLast {
println 'JDK packaging will be fully implemented in v26.0-Alpha.3'
println 'For now, OpenJDK images are available in openjdk-25/build/*/images/jdk'
}
}
task packageJRE {
group = 'distribution'
description = 'Package JRE distribution (requires OpenJDK build)'
dependsOn buildOpenJDK
doLast {
println 'JRE packaging will be fully implemented in v26.0-Alpha.3'
println 'For now, OpenJDK images are available in openjdk-25/build/*/images/jre'
}
}
task packageAgent(type: Jar) {
dependsOn ':aprismate-agent:shadowJar'
group = 'distribution'
description = 'Package standalone AprismateAgent jar'
}