Skip to content

Commit 587d57b

Browse files
author
oraclejet
committed
Release 2.3.0
1 parent 0c217d0 commit 587d57b

33 files changed

+581
-578
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to oraclejet-tooling
22

3-
*Copyright (c) 2014,2016 Oracle and/or its affiliates
3+
*Copyright (c) 2014, 2017 Oracle and/or its affiliates
44
The Universal Permissive License (UPL), Version 1.0*
55

66
**Pull requests are currently not being accepted for the Oracle JET project.**

Gruntfile.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
module.exports = function (grunt) {
@@ -16,9 +16,11 @@ module.exports = function (grunt) {
1616
src : "build/*.js"
1717
},
1818
pkg: grunt.file.readJSON("package.json"),
19-
jet_version_token:'2.2.0',
20-
jet_doc_version_token:'undefined',
21-
version_token:'2.2.0'
19+
build_urls: grunt.file.readJSON("buildconf.json"),
20+
jet_version_token:'2.3.0',
21+
jet_doc_version_token:'230',
22+
version_token:'2.3.0',
23+
current_year_token: '2017'
2224
}
2325
var configs = require('load-grunt-configs')(grunt, options);
2426
grunt.config.merge(configs);

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717

1818

1919
```
20-
Copyright (c) 2014, 2016 Oracle and/or its affiliates
20+
Copyright (c) 2014, 2017 Oracle and/or its affiliates
2121
The Universal Permissive License (UPL), Version 1.0
2222
2323
Subject to the condition set forth below, permission is hereby granted to any person obtaining

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# oraclejet-tooling 2.2.0
2-
3-
> Programmatic API to build and serve Oracle JET web and mobile applications
1+
# oraclejet-tooling 2.3.0
42

53
## About the tooling API
64
This tooling API contains methods to build and serve Oracle JET web and hybrid mobile apps. It is intended to be used with task running tools such as grunt or gulp. The APIs can also be invoked directly.
75

86
This is an open source project maintained by Oracle Corp.
97

108
## Installation
11-
The oraclejet-tooling API will be automatically installed if you scaffold a web or hybrid mobile app following the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet220/jet/).
9+
The oraclejet-tooling API will be automatically installed if you scaffold a web or hybrid mobile app following the [Oracle JET Developers Guide](http://docs.oracle.com/middleware/jet230/jet/).
1210

1311
## Usage
1412
The oraclejet-tooling API contains a build API that will build the app with dev or release mode, and other options. It also contains a serve API that serves up your app to browser/simulator/device. Please refer to the source code for details on how to invoke and use the API methods.
@@ -19,5 +17,5 @@ Oracle JET is an open source project. Pull Requests are currently not being acc
1917
for details.
2018

2119
## [License](https://github.com/oracle/oraclejet-tooling/tree/master/LICENSE.md)
22-
Copyright (c) 2014, 2016 Oracle and/or its affiliates
20+
Copyright (c) 2014, 2017 Oracle and/or its affiliates
2321
The Universal Permissive License (UPL), Version 1.0

RELEASENOTES.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
## Release Notes for oraclejet-tooling ##
22

3-
### 2.2.0 (Oct 21, 2016)
4-
* Allow developers to configure release paths
5-
* Provide help page for tooling tasks
6-
* Allow multiple themes to be included in a built app
7-
* Grunt serve to specific iOS emulator fails
8-
* no-build option missing from grunt serve
3+
### 2.3.0
4+
* No changes - refer to generator-oraclejet RELEASENOTES.md

hooks/jetAfterPrepare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
/**
3-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
3+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
44
The Universal Permissive License (UPL), Version 1.0
55
*/
66
'use strict';

hooks/jetInjector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/buildCommon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/buildHybrid.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';
@@ -42,7 +42,7 @@ function _invokeCordovaPrepare(context) {
4242
}
4343

4444
function _getCordovaBuildType(target) {
45-
return (target === 'release') ? CONSTANTS.RELEASE_BUILD_TYPE : CONSTANTS.DEBUG_BUILD_TYPE;
45+
return (target === 'release') ? CONSTANTS.RELEASE_FLAG : CONSTANTS.DEBUG_FLAG;
4646
}
4747

4848
function _getCordovaBuildConfig(bConfig) {
@@ -63,23 +63,26 @@ function _getCordovaBuildDestination(destination) {
6363
return `--${destination}`;
6464
}
6565

66+
function _getCordovaPlatformOptions(platformOptions) {
67+
return (platformOptions) ? `-- ${platformOptions}` : '';
68+
}
69+
6670
function _invokeCordovaCompile(context) {
6771
console.log('invoke cordova compile.....');
6872
const platform = context.platform;
6973
const opts = context.opts;
7074
let cwd = opts.stagingPath;
7175
cwd = path.resolve(cwd, '..');
7276

73-
let buildType = context.buildType;
74-
let buildConfig = opts.buildConfig;
75-
let buildDestination = opts.destination;
76-
buildType = _getCordovaBuildType(buildType);
77-
buildConfig = _getCordovaBuildConfig(buildConfig);
78-
buildDestination = _getCordovaBuildDestination(buildDestination);
77+
const buildType = _getCordovaBuildType(context.buildType);
78+
const buildConfig = _getCordovaBuildConfig(opts.buildConfig);
79+
const buildDestination = _getCordovaBuildDestination(opts.destination);
80+
const platformOptions = _getCordovaPlatformOptions(opts.platformOptions);
7981

8082
return new Promise((resolve, reject) => {
8183
let cmd = `cordova compile ${platform} ${buildType} ${buildDestination}`;
8284
if (buildConfig) cmd += ` ${buildConfig}`;
85+
if (platformOptions) cmd += ` ${platformOptions}`;
8386
const cmdOpts = { cwd: util.destPath(cwd), stdio: ['pipe', 'pipe', 'pipe'], maxBuffer: 1024 * 20000 };
8487
const cordova = exec(cmd, cmdOpts, (error) => {
8588
if (error) reject(error);

lib/buildWeb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/clean.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
55
'use strict';

lib/config.js

Lines changed: 86 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,89 @@
11
/**
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
33
The Universal Permissive License (UPL), Version 1.0
44
*/
5-
6-
'use strict';
7-
8-
const fs = require("fs-extra");
9-
const util = require("./util");
10-
const CONSTANTS = require("./constants");
11-
const path = require("path");
12-
13-
var config = module.exports = function(prop, value) {
14-
if (arguments.length === 2) {
15-
return config.set(prop, value);
16-
} else {
17-
return config.get(prop);
18-
}
19-
};
20-
21-
config.data = {};
22-
23-
/**
24-
* Get the config value
25-
* @param {String} prop property to get
26-
* @returns {String} return
27-
*/
28-
config.get = function(prop) {
29-
if (prop) {
30-
return config.data[prop];
31-
} else {
32-
return config.data;
33-
}
34-
};
35-
36-
/**
37-
* Set the config value
38-
* @param {String} prop property to set
39-
* @param {*} value value to set
40-
* @returns {String} return
41-
*/
42-
config.set = function(prop, value) {
43-
return config.data[prop] = value;
44-
};
45-
46-
/**
47-
* Create a new config
48-
* @param {Object} value to set the config.data to
49-
* @returns {String} return
50-
*/
51-
config.init = function(obj) {
52-
_loadOraclejetConfig();
53-
return (config.data = obj || {});
54-
};
55-
56-
config.loadOraclejetConfig = () => {
57-
const configJson = _readConfigJson();
58-
let src = {};
59-
let staging = {};
60-
src.common = path.normalize(configJson.paths.source.common) || CONSTANTS.APP_SRC_DIRECTORY;
61-
src.javascript = path.normalize(configJson.paths.source.javascript) || "js";
62-
src.styles = path.normalize(configJson.paths.source.styles) || "css";
63-
src.themes = path.normalize(configJson.paths.source.themes) || "themes";
64-
src.web = path.normalize(configJson.paths.source.web) || CONSTANTS.APP_SRC_WEB_DIRECTORY;
65-
src.hybrid = path.normalize(configJson.paths.source.hybrid) || CONSTANTS.APP_SRC_HYBRID_DIRECTORY;
66-
staging.web = path.normalize(configJson.paths.staging.web) || CONSTANTS.WEB_DIRECTORY;
67-
staging.hybrid = path.normalize(configJson.paths.staging.hybrid) || CONSTANTS.CORDOVA_DIRECTORY;
68-
staging.themes = path.normalize(configJson.paths.staging.themes) || CONSTANTS.APP_THEMES_DIRECTORY;
69-
config.data.paths = {src, staging};
70-
return {src, staging};
71-
};
72-
73-
function _readConfigJson(){
74-
const configPath = util.destPath(CONSTANTS.ORACLE_JET_CONFIG_JSON);
75-
return util.fsExistsSync(configPath) ? fs.readJsonSync(configPath) : undefined;
76-
};
77-
5+
6+
'use strict';
7+
8+
const fs = require('fs-extra');
9+
const util = require('./util');
10+
const CONSTANTS = require('./constants');
11+
const path = require('path');
12+
13+
const config = module.exports = function (prop, value) {
14+
if (arguments.length === 2) {
15+
return config.set(prop, value);
16+
} else {
17+
return config.get(prop);
18+
}
19+
};
20+
21+
config.data = {};
22+
23+
/**
24+
* Get the config value
25+
* @param {String} prop property to get
26+
* @returns {String} return
27+
*/
28+
config.get = function (prop) {
29+
if (prop) {
30+
return config.data[prop];
31+
} else {
32+
return config.data;
33+
}
34+
};
35+
36+
/**
37+
* Set the config value
38+
* @param {String} prop property to set
39+
* @param {*} value value to set
40+
* @returns {String} return
41+
*/
42+
config.set = function (prop, value) {
43+
return config.data[prop] = value;
44+
};
45+
46+
/**
47+
* Create a new config
48+
* @param {Object} value to set the config.data to
49+
* @returns {String} return
50+
*/
51+
config.init = function (obj) {
52+
_loadOraclejetConfig();
53+
return (config.data = obj || {});
54+
};
55+
56+
config.loadOraclejetConfig = () => _loadOraclejetConfig();
57+
58+
config.getConfiguredPaths = () => _getConfiguredPaths();
59+
60+
function _loadOraclejetConfig() {
61+
config.data.paths = _getConfiguredPaths();
62+
}
63+
64+
function _getConfiguredPaths() {
65+
const configJson = _readConfigJson();
66+
const src = {};
67+
const staging = {};
68+
const srcConfig = configJson.paths ? configJson.paths.source : {};
69+
const stagingConfig = configJson.paths ? configJson.paths.staging : {};
70+
71+
src.common = srcConfig.common ? path.normalize(srcConfig.common) : CONSTANTS.APP_SRC_DIRECTORY;
72+
src.javascript = srcConfig.javascript ? path.normalize(srcConfig.javascript) : 'js';
73+
src.styles = srcConfig.styles ? path.normalize(srcConfig.styles) : 'css';
74+
src.themes = srcConfig.themes ? path.normalize(srcConfig.themes) : 'themes';
75+
src.web = srcConfig.web ? path.normalize(srcConfig.web) : CONSTANTS.APP_SRC_WEB_DIRECTORY;
76+
src.hybrid = srcConfig.hybrid ? path.normalize(srcConfig.hybrid) : CONSTANTS.APP_SRC_HYBRID_DIRECTORY;
77+
78+
staging.web = stagingConfig.web ? path.normalize(stagingConfig.web) : CONSTANTS.WEB_DIRECTORY;
79+
staging.hybrid = stagingConfig.hybrid ? path.normalize(stagingConfig.hybrid) : CONSTANTS.CORDOVA_DIRECTORY;
80+
staging.themes = stagingConfig.themes ? path.normalize(stagingConfig.themes) : CONSTANTS.APP_THEMES_DIRECTORY;
81+
return { src, staging };
82+
}
83+
84+
function _readConfigJson() {
85+
const configPath = util.destPath(CONSTANTS.ORACLE_JET_CONFIG_JSON);
86+
const configJson = util.fsExistsSync(configPath) ? fs.readJsonSync(configPath) : null;
87+
config.set('defaultBrowser', configJson.defaultBrowser || CONSTANTS.DEFAULT_BROWSER);
88+
return configJson;
89+
}

0 commit comments

Comments
 (0)