spritebuilder / SpriteBuilder

Objective-C Game Development Suite
http://www.spritebuilder.com/
Other
740 stars 292 forks source link

Default .gitignore breaks continuous integration #686

Open devknoll opened 10 years ago

devknoll commented 10 years ago

Issue #482 made .gitignore exclude the "Source/Resources/Published-iOS" directory. In theory this is a good idea, except that it breaks all continuous integration.

One possible solution would be a command line interface to publish SpriteBuilder files (the current osascript doesn't cut it as it requires the project to be open and ready in SpriteBuilder). Even this is less than ideal as future versions of SpriteBuilder could change how publish works.

For now we'll just remove that line from our .gitignore files.

NickyWeber commented 10 years ago

The directive in the .gitignore is just a template. It might not be applicable to your sophisticated environment. The general idea stands to not version control generated content.

I agree that a command line interface for publishing would help. There are some changes ahead regarding publishing, so we like to wait until those changes are finalized and tested before we add command line support or another automation functionality. The changes will be of course compatible with what's publishing doing at the moment.

jonnyijapan commented 10 years ago

Not sure if this is related; I got a problem with building using CI also. I'm always using Jenkins (fully automated build) on a different computer for builds that ultimately publish test builds to TestFlight. In SpriteBuilder 1.1 (or specifically, in the xcodeproject generated by SpriteBuilder 1.1) there is this build step "Run Script" with the command:

osascript -e 'tell application "System Events"' -e 'set ProcessList to name of every process' -e 'if "SpriteBuilder" is in ProcessList then' -e 'tell application "SpriteBuilder" to publish' -e 'end if' -e 'end tell'

← This command somehow makes the build fail. It was kind of hard to track down because I couldn't find a trace of that osascript line in the build logs, but when comparing the build steps between an older, working project, the only difference was this Run Script step. So I tried removing it, and builds now work. Actually I guess it might not be related because I don't use git at all - Jenkins checks out from a SVN repository.

Btw the build logs ended like this: /bin/sh -c \"/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/nagatoquiz-bgyzlvwuntvkenbdjwogrbbzbumz/Build/Intermediates/ArchiveIntermediates/nagatoquiz\ adhoc/IntermediateBuildFilesPath/nagatoquiz.build/Adhoc-iphoneos/nagatoquiz.build/Script-D2E0167A18D782EC00927430.sh\" _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. 52:56: execution error: An error of type -10810 has occurred. (-10810)

\ ARCHIVE FAILED **

The following build commands failed: PhaseScriptExecution Run\ Script /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/nagatoquiz-bgyzlvwuntvkenbdjwogrbbzbumz/Build/Intermediates/ArchiveIntermediates/nagatoquiz\ adhoc/IntermediateBuildFilesPath/nagatoquiz.build/Adhoc-iphoneos/nagatoquiz.build/Script-D2E0167A18D782EC00927430.sh (1 failure)

NickyWeber commented 10 years ago

@jonnyijapan I think this is not related.

The run script will tell an open SpriteBuilder process to publish. There's no harm done in removing it.

jonnyijapan commented 10 years ago

Ok thanks. I think it fails because it cannot open a GUI - maybe the script could be changed to check if a GUI is used or not.

dillon-courts commented 9 years ago

Late to the party but I ran into this issue today and found a work around. You can invoke a shell script to open the SpriteBuilder application with the current project on your continuous integration server. We are using XCode Server so I added it to one of my bots. Something very similar could be done with something like Jenkins.

  open -a /Applications/SpriteBuilder.app ../<name_of_project>.spritebuilder

Then you can run the included script to publish. I added a sleep because I was finding that the SpriteBuilder was not opening fast enough and the script was running too early.

  sleep 5
  osascript -e 'tell application "System Events"' -e 'set ProcessList to name of every process' -e 'if "SpriteBuilder" is in ProcessList then' -e 'tell application "SpriteBuilder" to publish' -e 'end if' -e 'end tell'