manual cli
java -jar component-id-generator.jar input.json output.json
automation with gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("com.jamilservices:component-id-generator:1.0.1")
}
}
tasks.register("jcomponentIdGenerator") {
group ="jamilservices"
dependsOn(tasks.setupDependencies)
JComponentIdGenerator.main(arrayOf("src/main/resources/components/component_names.json", "src/main/resources/components/component_ids.json"))
}
tasks.register<Copy>("copyIdsGeneratedResources") {
group ="jamilservices"
dependsOn("jcomponentIdGenerator")
from("src/main/resources/components/component_*.json")
into("build/resources/components")
}
tasks.named("processResources") {
dependsOn("copyIdsGeneratedResources")
}
[
"prefix.component1",
"prefix.component2",
"prefix.component3"
]
{
"prefix.component1": "06737df5-5af9-439e-ba98-cbad6c692519",
"prefix.component2": "846c9b3c-99a6-4662-a966-d404fc0380c9",
"prefix.component3": "5d4ab4b9-58ad-4b0f-9db1-2307ca9c9841"
}