Skip to content

Commit 0c82af4

Browse files
committed
Larger alloy projects were failing. I still need to account for commonJS modules. Removed wrench dependencies
1 parent 33277da commit 0c82af4

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fixappjs",
3-
"version": "1.0.3",
3+
"version": "1.4.1",
44
"description": "A Titanium plugin to fix app.js in xcodeproj",
55
"scripts": {
66
"postinstall": "node run install",
@@ -12,10 +12,10 @@
1212
},
1313
"dependencies": {
1414
"ioslib": "0.15.4",
15-
"wrench": "1.5.9",
1615
"node-appc": "0.2.39",
1716
"xcode": "0.8.9",
18-
"tiapp.xml": "^0.2.2"
17+
"tiapp.xml": "^0.2.2",
18+
"fs-extra":"1.0.0"
1919
},
2020
"keywords": [
2121
"appcelerator",

plugin/fixappjs/1.0.3/hooks/postcompile.js renamed to plugin/fixappjs/1.4/hooks/postcompile.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
var xcode = require('xcode'),
2-
fs = require('fs'),
2+
fs = require('fs-extra'),
33
path = require('path'),
4-
wrench = require("wrench"),
54
spawn = require('child_process').spawn,
65
utils = require('../../../../utils'),
76
tiapp = require('tiapp.xml').load('./tiapp.xml');
@@ -121,7 +120,7 @@ function copyCompiledResources(logger, data, next) {
121120
iphone = new RegExp('iphone', 'i');
122121

123122
isAlloy ? resourcesPath = alloyResourcesPath(parentDir) : classicResourcesPath(parentDir);
124-
123+
/**
125124
wrench.readdirRecursive(resourcesPath, function(error, files) {
126125
if (files !== null) {
127126
files.forEach(file => {
@@ -134,7 +133,17 @@ function copyCompiledResources(logger, data, next) {
134133
}
135134
});
136135
}
137-
});
136+
});**/
137+
var tiSourceAddToResources =fs.readdirSync(resourcesPath);
138+
for (var i in tiSourceAddToResources) {
139+
if (String(tiSourceAddToResources[i]).match(android) || String(tiSourceAddToResources[i]).match(mobileweb)) {
140+
logger.trace((tiSourceAddToResources[i] + ' ignored').grey);
141+
}else {
142+
logger.info((tiSourceAddToResources[i] + ' added to Xcode Project').grey);
143+
myProj.addResourceFile( resourcesPath + tiSourceAddToResources[i]);
144+
}
145+
fs.writeFileSync(projectPath, myProj.writeSync());
146+
}
138147
console.log('Congrats, you now have a corrected xcodeproj!');
139148
});
140149
});

run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var CONF = require('./package.json')
44
var spawn = require('child_process').spawn
55
var path = require('path')
6-
var version = CONF.version.split('.').slice(0, 3).join('.')
6+
var version = CONF.version.split('.').slice(0, 2).join('.')
77
var plugin = path.join(__dirname, 'plugin', CONF.name, version, 'hooks')
88

99
function info (i) { process.stdout.write('\033[1;32m' + i + '\033[0m\n') }

0 commit comments

Comments
 (0)