@@ -150,16 +150,27 @@ kotlin {
150150
151151val zitiVersion = libs.versions.ziti.cli.get()
152152val binDir = layout.buildDirectory.dir(" bin" ).get()
153+ val srcDir = layout.buildDirectory.dir(" ziti-src" ).get()
153154val zitiCLI = binDir.file(" ziti" )
154155val quickstartHome = layout.buildDirectory.dir(" quickstart" ).get()
155156
157+ tasks.register<Exec >(" zitiCheckout" ) {
158+ group = LifecycleBasePlugin .BUILD_GROUP
159+ description = " checkout ziti cli source"
160+ commandLine(" env" , " git" , " clone" ,
161+ " --depth" , " 1" , " --branch" , " v${zitiVersion} " ,
162+ " https://github.com/openziti/ziti" , " ${srcDir.asFile.absolutePath} "
163+ )
164+ }
165+
156166tasks.register<Exec >(" buildZiti" ) {
157167 group = LifecycleBasePlugin .BUILD_GROUP
158168 description = " Builds the Ziti CLI"
169+ workingDir(srcDir)
170+
159171 environment(" GOBIN" , binDir.asFile.absolutePath)
160- commandLine(" env" ,
161- " go" , " install" , " github.com/openziti/ziti/ziti@v${zitiVersion} "
162- )
172+ environment(" GOWORK" , " off" )
173+ commandLine(" env" , " go" , " install" , " ./ziti" )
163174 outputs.file(zitiCLI)
164175}
165176
0 commit comments