Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion desktop/Scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ $USER = "root" ]; then
exit 1
fi

DECO_VERSION=0.7.0
DECO_VERSION=0.7.1

rm -rf ~/Library/Application\ Support/com.decosoftware.Deco/libs
mkdir -p ~/Library/Application\ Support/com.decosoftware.Deco/libs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var path = require('path')

module.exports = function(projectName) {
return {
iosTarget: path.join("ios/build/Build/Products/Debug-iphonesimulator/", projectName, ".app"),
iosTarget: path.join("ios/build/Build/Products/Debug-iphonesimulator/", projectName + ".app"),
iosProject: path.join("ios", projectName + ".xcodeproj"),
iosBuildScheme: projectName,
androidManifest: path.join("android/app/src/main/AndroidManifest.xml"),
Expand Down
4 changes: 1 addition & 3 deletions desktop/deco_unpack_lib/Scripts/deco-tool/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const handleError = (e) => {
errorMessage: `Error in config: ${e.toString()}`,
})
} else {
console.error(`\nLocal config is broken: \n\n[${e}]\n`)
console.error(`\nError in config: \n\n[${e}]\n`)
process.exit(1)
}
}
Expand Down Expand Up @@ -210,7 +210,6 @@ try {
fs.statSync(settingsPath)
PROJECT_SETTING = JSON.parse(stripComments(fs.readFileSync(settingsPath).toString()))
} catch (e) {
console.log('Warning: No local .settings file is present at path: ' + settingsPath + ' falling back to defaults.')
try {
const getDefaults = require(path.join(moduleWorkingDir, 'default.settings.js'))
const projectName = path.basename(process.cwd())
Expand Down Expand Up @@ -315,6 +314,5 @@ try {
}
})
} catch (e) {
console.error(e)
handleError(e)
}
49 changes: 48 additions & 1 deletion desktop/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ var gulpFail = require('gulp-fail');
var path = require('path');
var webpack = require("webpack");
var webpackProductionConfig = require("./webpack.production.config.js");
var webpackDevConfig = require("./webpack.config.js");
var ElectronPackager = require('electron-packager');
var child_process = require('child_process');
var fs = require('fs');
var plist = require('plist');
var $ = require('gulp-load-plugins')();
var open = require('gulp-open');
var runSequence = require('run-sequence');

var BUILD_VERSION = "0.7.0";
var BUILD_VERSION = "0.7.1";

var SIGN_PACKAGE = process.env['SIGN_DECO_PACKAGE'] == 'true'

var child = null
var debug_child = null
gulp.task('clean-pkg', $.shell.task(["rm -rf " + (path.join(__dirname, '../dist')), "mkdir -p " + (path.join(__dirname, '../dist/osx'))]));

gulp.task('copy-libraries', ['electron-pack'], $.shell.task(["mkdir " + '../app/deco/Deco-darwin-x64/Deco.app/Contents/Resources/app.asar.unpacked', "cp -rf " + (path.join(__dirname, './package/deco_unpack_lib/*')) + " " + (path.join(__dirname, '../app/deco/Deco-darwin-x64/Deco.app/Contents/Resources/app.asar.unpacked/'))]));
Expand Down Expand Up @@ -108,6 +111,19 @@ gulp.task("build", function(callback) {
});
});

gulp.task("build-dev", function(callback) {
return webpack(webpackDevConfig, function(err, stats) {
if (err) {
throw new gutil.PluginError("webpack:build", err);
}
gutil.log("[webpack:build]", stats.toString({
colors: true
}));
callback();
});
});


gulp.task('build-web', ['build', 'clean-pkg'], function(callback) {
child_process.execSync('npm run build', {
cwd: path.join(__dirname, '../web')
Expand All @@ -123,10 +139,41 @@ gulp.task("start", ["build"], function(callback) {
});
});

gulp.task('debug', ['run-debug-processes'], function(callback) {
gulp.src(__filename)
.pipe(open({
uri: 'http://127.0.0.1:3000/?port=5858',
//TODO: needs to change for OS once we support other platforms
app: '/Applications/Google\ Chrome.app',
}))
callback()
});

gulp.task("run-debug-processes", ["build-dev"], function(callback) {
child = child_process.fork("" + (path.join(__dirname, './node_modules/.bin/electron')), ["--debug-brk=5858", __dirname, "--dev-mode"], {
cwd: __dirname,
env: process.env
});
debug_child = child_process.fork("" + (path.join(__dirname, './node_modules/.bin/electron')), [
"node_modules/node-inspector/bin/inspector.js",
"--web-port=3000",
], {
cwd: __dirname,
env: Object.assign({},
process.env, {
ELECTRON_RUN_AS_NODE: true,
})
});
callback()
})

process.on('exit', function() {
if (child != null && !child.killed) {
child.kill();
}
if (debug_child != null && !debug_child.killed) {
debug_child.kill();
}
});

gulp.task('default', function() {
Expand Down
4 changes: 4 additions & 0 deletions desktop/install-debug-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh

./node_modules/.bin/node-pre-gyp --target=1.1.2 --runtime=electron --fallback-to-build --directory node_modules/v8-debug/ --dist-url=https://atom.io/download/atom-shell reinstall
./node_modules/.bin/node-pre-gyp --target=1.1.2 --runtime=electron --fallback-to-build --directory node_modules/v8-profiler/ --dist-url=https://atom.io/download/atom-shell reinstall
2 changes: 1 addition & 1 deletion desktop/installer/osx/mpkg/Distribution
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!--+==========================+
| Package References |
+==========================+-->
<pkg-ref id="com.decosoftware.deco" version="0.7.0" auth="Root" installKBytes="0">#Deco.pkg</pkg-ref>
<pkg-ref id="com.decosoftware.deco" version="0.7.1" auth="Root" installKBytes="0">#Deco.pkg</pkg-ref>
<!--+==========================+
| JavaScript Scripts |
+==========================+-->
Expand Down
6 changes: 5 additions & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DecoIDE-Desktop",
"version": "0.7.0",
"version": "0.7.1",
"main": "build/app.js",
"devDependencies": {
"babel-core": "^6.7.2",
Expand All @@ -12,15 +12,19 @@
"gulp": "^3.8.11",
"gulp-fail": "^1.0.1",
"gulp-load-plugins": "^0.8.1",
"gulp-open": "^2.0.0",
"gulp-shell": "^0.3.0",
"gulp-util": "^3.0.4",
"node-inspector": "^0.12.8",
"node-pre-gyp": "^0.6.29",
"plist": "^1.2.0",
"run-sequence": "^1.2.1",
"webpack": "^1.12.14"
},
"scripts": {
"start": "./node_modules/.bin/gulp start",
"pack": "./node_modules/.bin/gulp pack",
"debug": "./node_modules/.bin/gulp debug",
"copy-libs": "./node_modules/.bin/gulp dev-unpack-lib",
"upgrade-project-template": "./node_modules/.bin/gulp upgrade-project-template"
},
Expand Down
13 changes: 6 additions & 7 deletions desktop/src/handlers/projectHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ import Logger from '../log/logger'

let unsavedMap = {}

const PROJECT_SETTINGS_TEMPLATE =`{
const PROJECT_SETTINGS_TEMPLATE = (projectName) => `{

// relative path from project root to the .app binary that is generated after building iOS
"iosTarget": "ios/build/Build/Products/Debug-iphonesimulator/Project.app",
"iosTarget": "ios/build/Build/Products/Debug-iphonesimulator/${projectName}.app",

// relative path from project root to the xcode project or workspace file for iOS build
"iosProject": "ios/Project.xcodeproj",
"iosProject": "ios/${projectName}.xcodeproj",

// scheme name to use when building in Deco
"iosBuildScheme": "Project",
"iosBuildScheme": "${projectName}",

// relative path from project to the AndroidManifest.xml file for your application
"androidManifest": "android/app/src/main/AndroidManifest.xml",
Expand Down Expand Up @@ -196,14 +196,15 @@ class ProjectHandler {
return new Promise((resolve, reject) => {
const metadataPath = path.join(rootPath, '.deco')
const settingsFilePath = path.join(metadataPath, '.settings')
const assumedProjectName = path.basename(rootPath)
try {
fs.statSync(settingsFilePath)
resolve(settingsFilePath)
} catch (e) {
if (e && e.code == 'ENOENT') {
mkdirp(metadataPath, () => {
try {
fs.writeFileSync(settingsFilePath, PROJECT_SETTINGS_TEMPLATE, {
fs.writeFileSync(settingsFilePath, PROJECT_SETTINGS_TEMPLATE(assumedProjectName), {
mode: '755'
})
resolve(settingsFilePath)
Expand Down Expand Up @@ -249,13 +250,11 @@ class ProjectHandler {
fs.stat(oldMetadataPath, (err, stats) => {
if (err) {
//project is clean
this.createProjectSettingsTemplate(rootPath)
return
}

fs.stat(newMetadataPath, (err, stats) => {
if (!err) {
this.createProjectSettingsTemplate(rootPath)
return //project is current
}
if (err.code == 'ENOENT') {
Expand Down
13 changes: 12 additions & 1 deletion desktop/src/process/taskLauncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,20 @@ class TaskLauncher {
cwd: LIB_FOLDER,
}))

let errors = ''

task.stderr.on('data', (data) => {
try {
var plainTextData = data.toString()
errors += plainTextData
} catch (e) {
Logger.error(e)
}
})

task.once('exit', (code, signal) => {
if (code == 1) {
launchCustomTaskErrorDialog(task.stderr.toString())
launchCustomTaskErrorDialog(errors)
}
})

Expand Down
54 changes: 54 additions & 0 deletions desktop/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
var path = require('path')
var webpack = require('webpack')
var fs = require('fs')

var nodeModules = {};
fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
nodeModules[mod] = 'commonjs ' + mod;
});


module.exports = {
entry: './src/main.js',
target: 'atom',
devtool: 'inline-source-map',
output: {
path: path.join(__dirname, 'build'),
filename: 'app.js'
},
resolve: {
alias: {
'shared': path.join(__dirname, '../shared/src'),
}
},
resolveLoader: {
modulesDirectories: ['..', 'node_modules']
},
node: {
__dirname: false
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
new webpack.ExternalsPlugin('commonjs', [
'electron',
]),
],
module: {
loaders: [
{ test: /\.json$/, loader: "json-loader" },
{
loader: 'babel',
test: /\.js$/,
query: {
presets: ['es2015',]
}
}
]
},
externals: nodeModules
}
17 changes: 4 additions & 13 deletions desktop/webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ module.exports = {
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
new webpack.ExternalsPlugin('commonjs', [
'electron',
]),
],
module: {
loaders: [
Expand All @@ -46,17 +49,5 @@ module.exports = {
}
]
},
externals: [
(function () {
var IGNORES = [
'electron'
];
return function (context, request, callback) {
if (IGNORES.indexOf(request) >= 0) {
return callback(null, "require('" + request + "')");
}
return callback();
};
})(),
].concat(nodeModules)
externals: nodeModules
}
2 changes: 1 addition & 1 deletion shared/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "DecoIDE-Shared",
"description": "Files shared between main and renderer electron process",
"version": "0.7.0",
"version": "0.7.1",
"author": "Deco Software <info@decosoftware.com>",
"dependencies": {
"babel-preset-es2015": "^6.6.0"
Expand Down
7 changes: 3 additions & 4 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "DecoIDE-Web",
"description": "A react native IDE",
"version": "0.7.0",
"version": "0.7.1",
"author": "Deco Software <info@decosoftware.com>",
"dependencies": {
"babel-core": "^5.8.22",
Expand Down Expand Up @@ -34,14 +34,13 @@
"react-redux": "^4.4.0",
"react-router": "2.0.0",
"react-router-redux": "^3.0.0",
"react-toggle-button": "^2.0.0",
"redux": "^3.3.1",
"redux-thunk": "^1.0.3",
"semver": "^5.1.0",
"sklad": "^4.1.1",
"style-loader": "^0.8.3",
"url-loader": "^0.5.7",
"react-addons-pure-render-mixin": "^15.1.0",
"classnames": "^2.2.5",
"uuid": "^2.0.1",
"webpack": "^1.12.2",
"webpack-dev-server": "^1.11.0"
Expand All @@ -60,7 +59,7 @@
"devDependencies": {
"babel-eslint": "^5.0.0",
"del": "^2.1.0",
"eslint": "^2.10.2",
"eslint": "^2.13.1",
"eslint-plugin-react": "^3.16.1",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.2",
Expand Down
Loading