@@ -144,7 +144,8 @@ var targetLinux = flag.Bool("target-linux", false, "Compiles for linux only, bot
144144var binDir = flag .String ("bin-dir" , "" , "Specifies OS_PLATFORM specific binaries to install when cross compiling" )
145145var distro = flag .Bool ("distro" , false , "Create gauge distributable" )
146146var verbose = flag .Bool ("verbose" , false , "Print verbose details" )
147- var skipWindowsDistro = flag .Bool ("skip-windows" , false , "Skips creation of windows distributable on unix machines while cross platform compilation" )
147+ var skipWindowsDistro = flag .Bool ("skip-windows" , false , "Skips creation of windows distributables on unix machines during cross platform compilation" )
148+ var skipNonWindowsDistro = flag .Bool ("skip-non-windows" , false , "Skips creation of non-windows distributables during cross platform compilation" )
148149var certFile = flag .String ("certFile" , "" , "Should be passed for signing the windows installer" )
149150
150151// Defines all the compile targets
@@ -295,33 +296,37 @@ func signExecutable(exeFilePath string, certFilePath string) {
295296}
296297
297298func createDarwinPackage () {
298- distroDir := filepath .Join (deploy , packageName ())
299- copyGaugeBinaries (distroDir )
300- if id := os .Getenv ("OS_SIGNING_IDENTITY" ); id == "" {
301- log .Printf ("No signing identity found . Executable won't be signed." )
302- } else {
303- runProcess ("codesign" , "-s" , id , "--force" , "--deep" , filepath .Join (distroDir , gauge ))
304- }
305- createZipFromUtil (deploy , packageName (), packageName ())
306- if err := os .RemoveAll (distroDir ); err != nil {
307- log .Printf ("failed to remove %s" , distroDir )
299+ if ! * skipNonWindowsDistro {
300+ distroDir := filepath .Join (deploy , packageName ())
301+ copyGaugeBinaries (distroDir )
302+ if id := os .Getenv ("OS_SIGNING_IDENTITY" ); id == "" {
303+ log .Printf ("No signing identity found . Executable won't be signed." )
304+ } else {
305+ runProcess ("codesign" , "-s" , id , "--force" , "--deep" , filepath .Join (distroDir , gauge ))
306+ }
307+ createZipFromUtil (deploy , packageName (), packageName ())
308+ if err := os .RemoveAll (distroDir ); err != nil {
309+ log .Printf ("failed to remove %s" , distroDir )
310+ }
308311 }
309312}
310313
311314func createLinuxPackage () {
312- distroDir := filepath .Join (deploy , packageName ())
313- copyGaugeBinaries (distroDir )
314- createZipFromUtil (deploy , packageName (), packageName ())
315- if err := os .RemoveAll (distroDir ); err != nil {
316- log .Printf ("failed to remove %s" , distroDir )
315+ if ! * skipNonWindowsDistro {
316+ distroDir := filepath .Join (deploy , packageName ())
317+ copyGaugeBinaries (distroDir )
318+ createZipFromUtil (deploy , packageName (), packageName ())
319+ if err := os .RemoveAll (distroDir ); err != nil {
320+ log .Printf ("failed to remove %s" , distroDir )
321+ }
317322 }
318323}
319324
320325func packageName () string {
321326 return fmt .Sprintf ("%s-%s-%s.%s" , gauge , getBuildVersion (), getGOOS (), getPackageArchSuffix ())
322327}
323328
324- func removeUnwatedFiles (dir , currentOS string ) error {
329+ func removeUnwantedFiles (dir , currentOS string ) error {
325330 fileList := []string {
326331 ".DS_STORE" ,
327332 ".localized" ,
@@ -355,7 +360,7 @@ func createZipFromUtil(dir, zipDir, pkgName string) {
355360
356361 windowsZipScript := filepath .Join (wd , "build" , "create_windows_zipfile.ps1" )
357362
358- err = removeUnwatedFiles (filepath .Join (dir , zipDir ), currentOS )
363+ err = removeUnwantedFiles (filepath .Join (dir , zipDir ), currentOS )
359364
360365 if err != nil {
361366 panic (fmt .Sprintf ("Failed to cleanup unwanted file(s): %s" , err ))
0 commit comments