joe_jenkins 1.0.3 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/helpers/jj_xcode.rb +13 -19
  2. data/lib/joe_jenkins.rb +21 -4
  3. metadata +3 -3
@@ -22,18 +22,6 @@ class JJXcode
22
22
  @projectDirectory = Dir.pwd
23
23
  end
24
24
 
25
- def methods()
26
- var = Array.new
27
- var.push "getInstalledProfiles"
28
- var.push "listProfiles"
29
- var.push "getTargets"
30
- var.push "doBuild"
31
- var.push "reSignApp"
32
- var.push "packageApp"
33
-
34
- var
35
- end
36
-
37
25
  def log(msg)
38
26
  JJDebugger.log(msg) if @verbose
39
27
  end
@@ -74,11 +62,17 @@ class JJXcode
74
62
  # Do an 'xcodebuild -configuration -xcconfig' with given params
75
63
  # @return The path to the .app file
76
64
 
77
- def doBuild(configuration="Debug", config="")
78
- if(config == "")
79
- config = createXCConfig()
80
- end
81
- output = doXcodeCall("-configuration #{configuration}"+(config.length>0 ? " -xcconfig #{config}" : ""))
65
+ def doBuild(configuration="Debug", target="")
66
+ configuration = "Debug" if(configuration == nil)
67
+ target = "" if(target == nil)
68
+ config = createXCConfig()
69
+
70
+ x_call = "-configuration #{configuration} "
71
+ x_call += "-target #{target} " if(target && target.length > 0)
72
+ x_call += "-xcconfig #{config}"
73
+
74
+
75
+ output = doXcodeCall(x_call)
82
76
  if(output.include?"BUILD SUCCEEDED")
83
77
  binaryLoc = binaryLocation(configuration)
84
78
  log "Build Output Here: #{binaryLoc}"
@@ -147,10 +141,10 @@ class JJXcode
147
141
  data += "CustomBundleID = #{@bundleIdentifier};\n"
148
142
  data += "GCC_PREPROCESSOR_DEFINITIONS = #{@macroFlags};\n"
149
143
 
150
- xc_s = File.new("config.xcconfig", "w")
144
+ xc_s = File.new("#{@projectDirectory}/config.xcconfig", "w")
151
145
  xc_s.write(data)
152
146
  xc_s.close
153
- return "config.xcconfig"
147
+ return "#{@projectDirectory}/config.xcconfig"
154
148
  end
155
149
 
156
150
  def getProjectInfo()
data/lib/joe_jenkins.rb CHANGED
@@ -4,28 +4,36 @@ require 'helpers/jj_xcode'
4
4
  require 'zip/zip'
5
5
  require 'plist'
6
6
  require 'json'
7
- require 'rest_client'
7
+
8
8
  class JoeJenkins
9
9
 
10
10
  attr_accessor :config
11
+ attr_accessor :xcode
11
12
 
12
13
  def initialize(verbose=false)
13
14
  @xcode = JJXcode.new(verbose)
14
15
  end
15
16
 
16
- def doBuildWithConfig(config)
17
+ def doBuildWithConfig(config, package=false)
17
18
  @config = config
18
19
 
19
20
  @xcode.profile = config[:profile]
20
21
  @xcode.signer = config[:signer]
21
22
  @xcode.bundleIdentifier = config[:bundleID]
22
-
23
- appOutputLocation = @xcode.doBuild(config[:configuration])
23
+ @xcode.macroFlags = config[:macros]
24
+ appOutputLocation = @xcode.doBuild(config[:configuration],config[:target])
24
25
 
25
26
  print "Write Config to #{@xcode.buildDir(@config[:configuration])+"/config.txt"}\n"
26
27
  File.open(@xcode.buildDir(@config[:configuration])+"/config.txt", "w") do |f|
27
28
  f.puts @config.to_json
28
29
  end
30
+
31
+ if(package)
32
+ print "Packaging #{appOutputLocation}\n"
33
+ appOutputLocation = @xcode.packageApp(appOutputLocation, @xcode.profile, File.dirname(appOutputLocation))
34
+ print "PACKAGED #{appOutputLocation}\n"
35
+ end
36
+
29
37
  # print "This is the output #{appOutputLocation}\n"
30
38
  return appOutputLocation
31
39
  end
@@ -41,6 +49,15 @@ class JoeJenkins
41
49
  print "\nPost complete #{res.to_str}\n<br/>"
42
50
  end
43
51
 
52
+ def moveBuild(build_file, bc_file_path)
53
+ print "Moving Build #{build_file} => #{bc_file_path}\n"
54
+ FileUtils.mkdir_p bc_file_path
55
+ if(File.exists?bc_file_path)
56
+ FileUtils.cp(build_file, bc_file_path+"/#{build_file.split('/').last}")
57
+
58
+ end
59
+ end
60
+
44
61
  def createDistributionPlist
45
62
 
46
63
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 3
9
- version: 1.0.3
8
+ - 6
9
+ version: 1.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Joseph Ridenour
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-08-03 00:00:00 -05:00
17
+ date: 2012-12-31 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies: []
20
20