generated from openremote/custom-project
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle
More file actions
71 lines (68 loc) · 2.66 KB
/
build.gradle
File metadata and controls
71 lines (68 loc) · 2.66 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
// Configure version based on Git tags
apply plugin: 'pl.allegro.tech.build.axion-release'
scmVersion {
releaseOnlyOnReleaseBranches = true
releaseBranchNames = ['main']
unshallowRepoOnCI.set(true)
versionCreator('simple')
repository {
remote.set('origin')
}
tag.prefix = 'V-'
}
allprojects {
// Apply common project setup
apply from: "${project.rootDir}/project.gradle"
}
// Uncomment the following to configure files to be encrypted/decrypted
// Each file must be explicitly added to .gitignore otherwise git commit will fail
// When using encryption the the GFE_PASSWORD environment variable must be set or the build will fail
// use ./gradlew encryptFiles to encrypt files
//apply plugin: 'io.openremote.com.cherryperry.gradle-file-encrypt'
//gradleFileEncrypt {
// // files to encrypt
// plainFiles.from("deployment/manager/fcm.json")
// // (optional) setup file mapping to store all encrypted files in one place for example
// //mapping = [ 'deployment/mySensitiveFile' : 'secrets/mySensitiveFile' ]
// // Use custom password provider as standard env mechanism doesn't seem to work
// passwordProvider = {
// def password = System.env.GFE_PASSWORD
// if (!password) {
// throw new IllegalStateException("GFE_PASSWORD environment variable must be set!")
// }
// return password.toCharArray()
// }
//}
//interface InjectedExecOps {
// @Inject //@javax.inject.Inject
// ExecOperations getExecOps()
//}
//
//tasks.register('checkFilesGitIgnoredNew') {
// def injected = project.objects.newInstance(InjectedExecOps)
//
// doLast {
// // The provided checkFilesGitIgnored task doesn't work on Windows so here's one that does
// def plainFiles = project.getProperties().get("gradleFileEncrypt").plainFiles
// plainFiles.each { plainFile ->
// def args = []
// if (org.apache.tools.ant.taskdefs.condition.Os.isFamily(org.apache.tools.ant.taskdefs.condition.Os.FAMILY_WINDOWS)) {
// args.add("cmd")
// args.add("/c")
// }
// args.add("git")
// args.add("check-ignore")
// args.add("-q")
// args.add(plainFile) // Assuming plainFile is a single file path
//
// def result = injected.execOps.exec {
// commandLine args
// ignoreExitValue = true // Allow the build to continue so we can check the exit value
// }
//
// if (result.exitValue != 0) {
// throw new GradleException("Command execution failed for file ${plainFile} with exit code: ${result.exitValue}")
// }
// }
// }
//}