-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
143 lines (122 loc) · 4.84 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
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
buildscript {
repositories {
mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
gradlePluginPortal() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
}
dependencies {
classpath 'com.palantir.gradle.jdks:gradle-jdks:0.59.0'
classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.16.0'
classpath 'com.palantir.baseline:gradle-baseline-java:5.72.0'
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.19.0'
classpath 'com.palantir.gradle.failure-reports:gradle-failure-reports:1.13.0'
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.50.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0'
}
}
plugins {
id 'java'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'com.palantir.git-version' version '3.1.0'
id 'com.autonomousapps.dependency-analysis' version '2.4.2'
id 'de.undercouch.download' version '5.6.0'
}
allprojects {
apply plugin: 'com.palantir.java-format'
}
apply plugin: 'com.palantir.external-publish-jar'
apply plugin: 'com.palantir.jdks'
apply plugin: 'com.palantir.baseline'
apply plugin: 'com.palantir.baseline-checkstyle'
apply plugin: 'com.palantir.baseline-config'
apply plugin: 'com.palantir.baseline-error-prone'
apply plugin: 'com.palantir.baseline-idea'
apply plugin: 'com.palantir.failure-reports'
apply plugin: 'com.palantir.baseline-java-versions'
apply plugin: 'com.palantir.jdks.latest'
group = 'com.palantir.isofilereader'
version gitVersion()
description = 'A Java library to natively read ISO-9660 and UDF files'
// Needed if baselineUpdateConfig is added to the build command
// checkstyleMain.dependsOn baselineUpdateConfig
// checkstyleTest.dependsOn baselineUpdateConfig
// dependencyUpdate Related
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
dependencyUpdates {
// Example 1: reject all non stable versions
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
repositories {
mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
}
test {
minHeapSize = "256m" // initial heap size
maxHeapSize = "4096m" // maximum heap size
useJUnitPlatform()
exclude '**/IsoImageTestsLargeIso.java'
exclude '**/OneOffTests.java'
}
task downloadRockyForTestingIfNotPresent(type: Download) {
src 'https://dl.rockylinux.org/vault/rocky/9.2/isos/x86_64/Rocky-9.2-x86_64-minimal.iso'
dest new File("${projectDir}/test_isos/", 'rocky.iso')
overwrite false
onlyIfModified true
retries 5
}
task verifyRockyFile(type: Verify, dependsOn: downloadRockyForTestingIfNotPresent) {
src "${projectDir}/test_isos/rocky.iso"
algorithm 'SHA256'
checksum '06505828e8d5d052b477af5ce62e50b938021f5c28142a327d4d5c075f0670dc'
}
task downloadUbuntuForTestingIfNotPresent(type: Download) {
src 'https://old-releases.ubuntu.com/releases/kinetic/ubuntu-22.10-live-server-amd64.iso'
dest new File("${projectDir}/test_isos/", 'ubuntu.iso')
overwrite false
onlyIfModified true
retries 5
}
task verifyUbuntuFile(type: Verify, dependsOn: downloadUbuntuForTestingIfNotPresent) {
src "${projectDir}/test_isos/ubuntu.iso"
algorithm 'SHA256'
checksum '874452797430a94ca240c95d8503035aa145bd03ef7d84f9b23b78f3c5099aed'
}
task downloadWindowsForTestingIfNotPresent(type: Download) {
// https://download.microsoft.com/download/c/1/1/c11d2ca5-967c-45c0-bc7d-2d9ca3f1fe07/Windows10Enterprise22H2HashValues.pdf
src 'https://go.microsoft.com/fwlink/p/?LinkID=2208844&clcid=0x409&culture=en-us&country=US'
dest new File("${projectDir}/test_isos/", 'windows.iso')
overwrite false
onlyIfModified true
retries 5
}
task verifyWindowsFile(type: Verify, dependsOn: downloadWindowsForTestingIfNotPresent) {
src "${projectDir}/test_isos/windows.iso"
algorithm 'SHA256'
checksum 'ef7312733a9f5d7d51cfa04ac497671995674ca5e1058d5164d6028f0938d668'
}
test.dependsOn(verifyRockyFile, verifyUbuntuFile, verifyWindowsFile)
publishMavenPublicationToMavenLocal.dependsOn(test)
dependencies {
testImplementation group: 'com.github.stephenc.java-iso-tools', name: 'loop-fs-iso-impl', version: '2.1.0'
testImplementation 'javax.xml.bind:jaxb-api:2.3.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
}
// To accept gradle scans and publish them
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}
javaVersions {
libraryTarget = 11
runtime = 21
}
jdks {
daemonTarget = 21
}