This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
fork.gradle.kts
51 lines (50 loc) · 1.96 KB
/
fork.gradle.kts
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
import com.neva.gradle.fork.ForkExtension
configure<ForkExtension> {
properties {
define(mapOf(
"projectLabel" to {
description = "Human-readable project name"
defaultValue = "Example"
},
"projectName" to {
description = "Artifact 'name' coordinate"
validator { lowercased(); alphanumeric() }
controller { other("targetPath").value = File(File(other("sourcePath").value).parentFile, value).toString() }
defaultValue = "example"
},
"projectGroup" to {
description = "Artifact 'group' coordinate and base Java package"
validator { javaPackage(); notEndsWith("projectName") }
defaultValue = "com.company.aem"
},
"sourcePath" to { enabled = false },
"targetPath" to { enabled = false }
))
}
config {
cloneFiles()
moveFiles(mapOf(
"/com/company/example/aem" to "/{{projectGroup|substitute('.', '/')}}/{{projectName}}/aem",
"/example" to "/{{projectName}}"
))
replaceContents(mapOf(
"com.company.example.aem" to "{{projectGroup}}.{{projectName}}.aem",
"com.company.example" to "{{projectGroup}}.{{projectName}}",
"com.company" to "{{projectGroup}}",
"Example" to "{{projectLabel}}",
"example" to "{{projectName}}"
))
copyTemplateFile("README.MD")
removeFiles(listOf(
"LICENSE",
"azure-pipelines.yml",
"gh-md-toc",
"docs/*",
"gradle/fork/fork.gradle.kts",
"gradle/fork/README.MD.peb"
))
removeTexts(listOf(
"""apply(from = "gradle/fork/fork.gradle.kts")""" + "\n"
))
}
}