diff --git a/deployment/build.gradle b/deployment/build.gradle index 5eb66ef30..7bb3bde8d 100644 --- a/deployment/build.gradle +++ b/deployment/build.gradle @@ -26,6 +26,7 @@ task license { } task installDist(type: Copy) { + duplicatesStrategy DuplicatesStrategy.EXCLUDE dependsOn (parent.getTasksByName('installDist', true).findAll { // Don't create circular dependency or depend on built in openremote submodule apps it.project != project && !it.project.path.startsWith(":openremote:ui:app") diff --git a/project.gradle b/project.gradle index 3304f27e4..93bd6bb01 100644 --- a/project.gradle +++ b/project.gradle @@ -227,7 +227,7 @@ def createTSGeneratorConfigForModel(String outputFileName, Project...customProje } return config } -def createTSGeneratorConfigForClient(String outputFileName, Project...customProjectsToScan) { +def createTSGeneratorConfigForClient(String outputFileName, File modelInfoJson, Project...customProjectsToScan) { def config = createTSGeneratorConfig(true, outputFileName, customProjectsToScan) << { extensions = [ @@ -251,7 +251,7 @@ def createTSGeneratorConfigForClient(String outputFileName, Project...customProj cz.habarta.typescript.generator.ModuleDependency.module( "model", "Model", - new File("$buildDir/typescript-generator-info.json"), + modelInfoJson, (String) null, (String) null ) diff --git a/ui/component/rest/build.gradle b/ui/component/rest/build.gradle index 7c208f03a..24d10308c 100644 --- a/ui/component/rest/build.gradle +++ b/ui/component/rest/build.gradle @@ -21,12 +21,8 @@ dependencies { implementation "com.fasterxml.jackson.module:jackson-module-parameter-names:$jacksonVersion" } -// This seems hacky but it is the only way to get the closure from the method call -project.task(Collections.singletonMap(Task.TASK_TYPE, cz.habarta.typescript.generator.gradle.GenerateTask), "generateTypescriptModelInfo") -generateTypescriptModelInfo createTSGeneratorConfigForModel("$buildDir/model.ts", findProject(":model")) - -generateTypeScript createTSGeneratorConfigForClient("src/restclient.ts", findProject(":model")) -generateTypeScript.dependsOn(generateTypescriptModelInfo) +generateTypeScript createTSGeneratorConfigForClient("src/restclient.ts", new File("${project(":ui:component:model").projectDir}/src/typescript-generator-info.json"), project(":model")) +generateTypeScript.dependsOn resolveTask(":ui:component:model:generateTypeScript") clean { doLast {