adaptrex 0.9.32 → 0.9.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/adaptrex/builder.rb +25 -17
  2. metadata +3 -3
@@ -52,14 +52,12 @@ class AdaptrexBuilder
52
52
  FileUtils.mv(sdkPath + "/src/ux/auth2", tmpDir + "_senchatouch_auth2")
53
53
  end
54
54
 
55
- #
56
- # Create Ghosts
57
- #
58
- if not createGhosts?(sdkPath, appPath) then return end
59
-
60
- if sdkType == "ext" then sdkFile = "ext" else sdkFile = "sencha-touch" end
61
-
55
+
62
56
  begin
57
+ if not createGhosts?(weblib, sdkPath, appPath) then return end
58
+
59
+ if sdkType == "ext" then sdkFile = "ext" else sdkFile = "sencha-touch" end
60
+
63
61
  cmd = [
64
62
  "sencha -d -sdk " + sdkPath + " compile",
65
63
  " -classpath ",
@@ -71,8 +69,9 @@ class AdaptrexBuilder
71
69
  " exclude -all",
72
70
  " and include -r -f " + appPath + "/app.js",
73
71
  " and exclude -f " + sdkPath + "/src",
74
- " and concat " + appPath + "/app-all-debug.js",
75
- " and concat -compress " + appPath + "/app-all.js",
72
+ " and exclude -f adaptrex/ghosts.js",
73
+ " and concat " + appPath + "/build/app-all-debug.js",
74
+ " and concat -compress " + appPath + "/build/app-all.js",
76
75
  " and save appset",
77
76
  " and exclude -all",
78
77
  " and include -r -f " + appPath + "/app.js",
@@ -80,8 +79,8 @@ class AdaptrexBuilder
80
79
  " and include -r -f " + includes,
81
80
  " and exclude -s appset",
82
81
  " and exclude -f " + includes,
83
- " and concat " + appPath + "/app-" + sdkFile + "-debug.js",
84
- " and concat -compress " + appPath + "/app-" + sdkFile + ".js"
82
+ " and concat " + appPath + "/build/app-" + sdkFile + "-debug.js",
83
+ " and concat -compress " + appPath + "/build/app-" + sdkFile + ".js"
85
84
  ].join("")
86
85
  compileOutput = `#{cmd}`
87
86
 
@@ -107,21 +106,30 @@ class AdaptrexBuilder
107
106
  # Scan for missing model/store dependencies that should be autogenerated
108
107
  #
109
108
  $failPattern = "failed to find meta class definition for name"
110
- def createGhosts?(sdkPath,appPath)
109
+ def createGhosts?(weblib,sdkPath,appPath)
111
110
  ghosts = "adaptrex/ghosts.js"
112
111
  if not File.exist?(ghosts) then File.open(ghosts, "w") {} end
113
112
 
114
- cmd = "sencha -sdk=" + sdkPath + " compile" +
115
- " -classpath=" + appPath + "/app.js," + appPath + "/app," + ghosts
116
- " exclude -a"
113
+ cmd = [
114
+ "sencha -d -sdk=" + sdkPath + " compile" +
115
+ " -classpath",
116
+ " adaptrex/ghosts.js," +
117
+ appPath + "/app.js,",
118
+ appPath + "/app,",
119
+ #weblib + "/" + appConfig.adaptrexVersion + "/" + sdkType + "/src,",
120
+ sdkPath + "/src",
121
+ " exclude -a"
122
+ ].join("")
117
123
  compileOutput = `#{cmd}`
118
124
 
119
125
  if compileOutput.include?"[ERR]"
120
126
  if compileOutput.include?$failPattern
121
127
  failedClass = compileOutput.split($failPattern)[1].split("\n")[0].strip
122
128
  if (failedClass.include?".store." or failedClass.include?".model.")
123
- File.open(ghosts,"a") {|f| f.puts("Ext.define('" + failedClass + "',{})")}
124
- return createGhosts?(sdkPath,appPath)
129
+ ghostsFile = File.open(ghosts,"a")
130
+ ghostsFile.puts("Ext.define('" + failedClass + "',{})")
131
+ ghostsFile.close()
132
+ return createGhosts?(weblib,sdkPath,appPath)
125
133
  end
126
134
  end
127
135
  false
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adaptrex
3
3
  version: !ruby/object:Gem::Version
4
- hash: 123
4
+ hash: 127
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 32
10
- version: 0.9.32
9
+ - 34
10
+ version: 0.9.34
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bob Obringer