@@ -94,6 +94,7 @@ target(name: "generateDomain", description: "Generates all of the json files for
9494 // and it also complicates Deserialization for our IdPs etc. Simplifying of collapsing the domain may be useful.
9595 domainDSLBuilder()
9696
97+ // Note this is fairly brittle because if the class moves this doesn't get updated.
9798 [
9899 "io.fusionauth.api.domain.annotation.InternalUse.json",
99100 "io.fusionauth.api.domain.json.annotation.MaskString.json",
@@ -151,18 +152,32 @@ void formatClientLibrary(String clientLibrary) {
151152}
152153
153154void domainDSLBuilder() {
154- ProcessBuilder pb = new ProcessBuilder("sb", "compile")
155- def process = pb.inheritIO().directory(new File("../fusionauth-app")).start()
156- process.consumeProcessOutput(System.out, System.err)
157- process.waitFor()
158- if (process.exitValue() != 0) {
155+ // This isn't ideal, and ideally this and all of the client builders would build
156+ // after fusionauth-app. That would be correct I think, however since we are still building
157+ // the FusionAuth Client for fusionauth-app in this repo, it is a bit of a chicken and egg
158+ // problem. So we can build fusionauth-plugin-api and fusionauth-app here first to be sure
159+ // we have the jars to build, or we could move all of this after.
160+ ProcessBuilder pluginPb = new ProcessBuilder("sb", "int")
161+ def pluginProcess = pluginPb.inheritIO().directory(new File("../fusionauth-plugin-api")).start()
162+ pluginProcess.consumeProcessOutput(System.out, System.err)
163+ pluginProcess.waitFor()
164+ if (pluginProcess.exitValue() != 0) {
165+ fail("Unable to run `sb int` for fusionauth-plugin-api")
166+ }
167+
168+ ProcessBuilder appPb = new ProcessBuilder("sb", "clean", "compile")
169+ def appProcess = appPb.inheritIO().directory(new File("../fusionauth-app")).start()
170+ appProcess.consumeProcessOutput(System.out, System.err)
171+ appProcess.waitFor()
172+ if (appProcess.exitValue() != 0) {
159173 fail("Unable to run `sb compile` for fusionauth-app")
160174 }
161175
162176 String classPath = "../fusionauth-app/build/classes/test:../fusionauth-app/build/classes/main:../fusionauth-app/build/domain-builder/lib/*"
163177
164178 var debug = switches.has("domain-debug") ? "debug" : ""
165- ProcessBuilder domainBuilder = new ProcessBuilder("${pb.environment().get("JAVA_HOME")}/bin/java", "-cp", classPath, "io.fusionauth.builders.DomainDSLBuilder", debug)
179+ var home = appPb.environment().get("HOME")
180+ ProcessBuilder domainBuilder = new ProcessBuilder("${home}/dev/java/current21/bin/java", "-cp", classPath, "io.fusionauth.builders.DomainDSLBuilder", debug)
166181 def domainBuilderProcess = domainBuilder.inheritIO().directory(new File("../fusionauth-app/")).start()
167182 domainBuilderProcess.consumeProcessOutput(System.out, System.err)
168183 domainBuilderProcess.waitFor()
0 commit comments