diff --git a/distro/pom.xml b/distro/pom.xml index 763eed9..7e476fe 100644 --- a/distro/pom.xml +++ b/distro/pom.xml @@ -361,6 +361,27 @@ + + + Copy Ozone Info to the final package + prepare-package + + copy-resources + + + ${project.build.directory}/${project.artifactId}-${project.version} + true + + + ${project.build.directory} + + ozone-info.json + + false + + + + @@ -495,6 +516,20 @@ + + Generate Ozone Info JSON file + process-resources + + execute + + + + + + + + Generate ERPNext data import script diff --git a/maven-parent/pom.xml b/maven-parent/pom.xml index 3a9cf6a..9aaef79 100644 --- a/maven-parent/pom.xml +++ b/maven-parent/pom.xml @@ -327,6 +327,27 @@ + + + Update Ozone Info + process-resources + + run + + + + + + def ozoneInfoFile = new File("${project.build.directory}/${project.artifactId}-${project.version}/distro/ozone-info.json") + def ozoneInfo = new groovy.json.JsonSlurper().parse(ozoneInfoFile) + ozoneInfo.name = "${project.artifactId}" + ozoneInfo.version = "${project.version}" + ozoneInfo.description = "${project.description}" + ozoneInfoFile.text = groovy.json.JsonOutput.prettyPrint(groovy.json.JsonOutput.toJson(ozoneInfo)) + + + + @@ -340,6 +361,16 @@ + + org.apache.groovy + groovy-ant + ${maven.groovy.version} + + + org.apache.groovy + groovy-json + ${maven.groovy.version} + @@ -641,4 +672,4 @@ - \ No newline at end of file + diff --git a/scripts/generate-ozone-info.groovy b/scripts/generate-ozone-info.groovy new file mode 100644 index 0000000..ae5c885 --- /dev/null +++ b/scripts/generate-ozone-info.groovy @@ -0,0 +1,9 @@ +import groovy.json.JsonOutput + +def json = [ + name: 'ozone', + version: project.version, + description: project.description +] + +new File(project.build.directory, 'ozone-info.json').text = JsonOutput.prettyPrint(JsonOutput.toJson(json)) diff --git a/scripts/pom.xml b/scripts/pom.xml index 5fa15b6..4f95a8c 100644 --- a/scripts/pom.xml +++ b/scripts/pom.xml @@ -57,6 +57,9 @@ erpnext/data_import/generate-import-script.groovy + + generate-ozone-info.groovy + go-to-scripts-dir.sh @@ -92,4 +95,4 @@ - \ No newline at end of file +