Commit e5a59e0e authored by Timo Tegtmeier's avatar Timo Tegtmeier

Massively changed build system

parent 94c73eb9
......@@ -8,7 +8,9 @@
<property name="debug.dir" value="${bin.dir}/debug" />
<!-- Create a Firefox OS package -->
<target name="Firefox OS" depends="build">
<target name="Firefox OS">
<build target="firefoxos" />
<copy file="targets/firefoxos/manifest.webapp" todir="${staging.dir}" />
<copy todir="${staging.dir}">
<fileset dir="icons" includes="icon32.png icon60.png icon90.png icon120.png icon128.png icon256.png" />
......@@ -22,43 +24,56 @@
<delete file="${release.dir}/feedreader-fxos-${version}.zip" />
<zip basedir="${staging.dir}" zipfile="${release.dir}/feedreader-fxos-${version}.zip" />
<antcall target="finish" />
<finish />
</target>
<!-- Create an Android APK -->
<target name="Android" depends="build">
<target name="Android">
</target>
<!-- Run the enyo build process and insert correct version number -->
<target name="build" depends="clean">
<exec executable="node">
<arg value="enyo/tools/deploy.js" />
<arg value="-o" />
<arg value="${staging.dir}" />
</exec>
<delete file="${staging.dir}/icon.png" />
<replace file="${staging.dir}/build/app.js" token="$VERSION$" value="${version}" />
<replace file="${staging.dir}/build/app.js" token="$VERSIONINT$" value="${version.int}" />
<replace file="build/app.js" token="$VERSION$" value="${version}" />
<replace file="build/app.js" token="$VERSIONINT$" value="${version.int}" />
</target>
<!-- Create a generic browser app -->
<target name="Generic">
<build target="generic" />
<!-- Clean the debug dir -->
<target name="clean" depends="prepare">
<delete includeemptydirs="true">
<fileset dir="${debug.dir}" includes="*" />
</delete>
</target>
<delete file="${release.dir}/feedreader-generic-${version}.zip" />
<zip basedir="${staging.dir}" zipfile="${release.dir}/feedreader-generic-${version}.zip" />
<!-- Prepare the source tree -->
<target name="prepare">
<mkdir dir="${debug.dir}" />
<mkdir dir="${release.dir}" />
<finish />
</target>
<!-- Run the enyo build process and insert correct version number -->
<macrodef name="build">
<attribute name="target" />
<sequential>
<mkdir dir="${debug.dir}" />
<mkdir dir="${release.dir}" />
<delete includeemptydirs="true">
<fileset dir="${debug.dir}" includes="*" />
</delete>
<exec executable="node">
<arg value="enyo/tools/deploy.js" />
<arg value="-p" />
<arg value="targets/@{target}/package.js" />
<arg value="-o" />
<arg value="${staging.dir}" />
<arg value="-v" />
<arg value="-s" />
<arg value="." />
</exec>
<delete file="${staging.dir}/icon.png" />
<replace file="${staging.dir}/build/app.js" token="$VERSION$" value="${version}" />
<replace file="${staging.dir}/build/app.js" token="$VERSIONINT$" value="${version.int}" />
<replace file="build/app.js" token="$VERSION$" value="${version}" />
<replace file="build/app.js" token="$VERSIONINT$" value="${version.int}" />
</sequential>
</macrodef>
<!-- Do some cleanup after the build has been finished -->
<target name="finish">
<delete dir="${staging.dir}" />
</target>
<macrodef name="finish">
<sequential>
<delete dir="${staging.dir}" />
</sequential>
</macrodef>
</project>
\ No newline at end of file
......@@ -6,8 +6,13 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script type="text/javascript">
window.$VERSIONINT$ = 1;
</script>
<script src="enyo/enyo.js" type="text/javascript"></script>
<script src="source/package.js" type="text/javascript"></script>
<script src="targets/generic/package.js" type="text/javascript"></script>
<script src="source/package.js" type="text/javascript"></script>
</head>
<body class="enyo-unselectable">
<img src="assets/nodata-background.png" style="position: absolute; margin: auto; top: 0; left: 0; right: 0; bottom: 0;"/>
......
/*
== DO NOT EDIT THIS FILE! ==
This is necessary to keep paths correct for the minification process
*/
enyo.depends("source");
......@@ -38,7 +38,6 @@ enyo.kind({
// Set global constants.
applyGlobalConstants(enyo.application);
enyo.Signals.send("constantsReady");
enyo.application.assert = enyo.bind(this, this.assert);
enyo.application.nop = function() {};
......
window.onload = function () {
window.enyo.application = {};
window.enyo.application = {};
applyOSSpecific();
......
......@@ -8,10 +8,6 @@ enyo.depends(
"$lib/g11n",
// OS specific stuff
"utils/os/generic.js",
"utils/os/firefox.js",
// Utility functions
"utils/constants.js",
"utils/formatting.js",
......@@ -31,7 +27,6 @@ enyo.depends(
// Business logic
"logic/prefs.js",
"logic/indexeddb.js",
"logic/feeds.js",
"logic/readitlater.js",
......
......@@ -24,14 +24,10 @@ enyo.kind({
name: "HelpDialog",
kind: ModalDialog,
autoDismiss: true,
caption: $L("FeedReader Help"),
components: [{
name: "title",
style: "font-weight: bold; font-size: 18px; margin-bottom: 0px;"
}, {
name: "author",
style: "font-weight: bold; font-size: 15px;"
style: "font-size: 15px; width: 100%; text-align: center;"
}, {
kind: enyo.Scroller,
horizontal: "hidden",
......@@ -112,10 +108,7 @@ enyo.kind({
content: $L("OK"),
ontap: "okClicked"
}]
}, {
kind: enyo.Signals,
onConstantsReady: "constantsReady"
}],
}],
openFeedReaderHomepage: function(sender, event) {
enyo.application.openLink("http://www.tegi-stuff.de/doku.php?id=feedreader");
......@@ -133,8 +126,9 @@ enyo.kind({
this.hide();
},
constantsReady: function() {
this.$.title.setContent(enyo.application.appName + ' v' + enyo.application.versionString);
show: function() {
this.setCaption(enyo.application.appName + ' v' + enyo.application.versionString);
this.$.author.setContent($L("by") + " " + enyo.application.appAuthor);
this.inherited(arguments);
}
});
......@@ -20,6 +20,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
function isFirefox() {
return enyo.platform.firefox || enyo.platform.firefoxOS;
}
function addBrowerClass(classes) {
if(isFirefox()) {
return classes + " mozilla";
......@@ -29,11 +33,3 @@ function addBrowerClass(classes) {
return classes + " webkit";
}
}
function applyOSSpecific() {
if(isFirefox()) {
applyFirefoxSpecifics();
} else {
applyGenericHandlers();
}
}
......@@ -54,7 +54,7 @@ enyo.kind({
});
enyo.kind({
name: "FirefoxAppHelper",
name: "AppHelper",
kind: enyo.Component,
hasHTMLMail: false,
......@@ -147,14 +147,42 @@ enyo.kind({
}
});
function fxOSHaveConnection() {
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
if(!connection) {
enyo.asyncMethod(this, onSuccess);
} else if(connection.bandwidth > 0) {
if(connection.bandwidth !== Infinity || navigator.onLine) {
return true;
} else {
return false;
}
} else {
return false;
}
}
enyo.kind({
name: "ConnectionChecker",
kind: enyo.Component,
checkConnection: function(onSuccess, onFail) {
if(fxOSHaveConnection()) {
enyo.asyncMethod(this, onSuccess);
} else {
enyo.asyncMethod(this, onFail);
}
}
});
enyo.kind({
name: "FirefoxTimer",
name: "Timer",
kind: enyo.Component,
cookieName: "comtegi-stuffAppFeedReaderAlarms",
components: [{
kind: "FirefoxConnectionChecker",
kind: "ConnectionChecker",
name: "connChecker"
}],
......@@ -221,36 +249,8 @@ enyo.kind({
}
});
function fxOSHaveConnection() {
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
if(!connection) {
enyo.asyncMethod(this, onSuccess);
} else if(connection.bandwidth > 0) {
if(connection.bandwidth !== Infinity || navigator.onLine) {
return true;
} else {
return false;
}
} else {
return false;
}
}
enyo.kind({
name: "FirefoxConnectionChecker",
kind: enyo.Component,
checkConnection: function(onSuccess, onFail) {
if(fxOSHaveConnection()) {
enyo.asyncMethod(this, onSuccess);
} else {
enyo.asyncMethod(this, onFail);
}
}
});
enyo.kind({
name: "FirefoxPowerManager",
name: "PowerManager",
kind: enyo.Component,
enterActivity: function() {
......@@ -261,7 +261,7 @@ enyo.kind({
});
enyo.kind({
name: "FirefoxApplicationEvents",
name: "ApplicationEvents",
kind: enyo.Component,
events: {
......@@ -287,17 +287,8 @@ enyo.kind({
}
});
function isFirefox() {
return enyo.platform.firefox || enyo.platform.firefoxOS;
}
function applyFirefoxSpecifics() {
window.AppHelper = window.FirefoxAppHelper;
window.Timer = window.FirefoxTimer;
window.ConnectionChecker = window.FirefoxConnectionChecker;
window.PowerManager = window.FirefoxPowerManager;
window.Database = window.IndexedDB;
window.ApplicationEvents = window.FirefoxApplicationEvents;
function applyOSSpecific() {
console.log("Running FxOS build");
enyo.xhr.getXMLHttpRequest = function(inParams) {
try {
......
......@@ -21,7 +21,7 @@
*/
enyo.kind({
name: "GenericAppHelper",
name: "AppHelper",
kind: enyo.Component,
hasHTMLMail: false,
......@@ -58,7 +58,7 @@ enyo.kind({
});
enyo.kind({
name: "GenericTimer",
name: "Timer",
kind: enyo.Component,
setTimer: function() {
......@@ -66,7 +66,7 @@ enyo.kind({
});
enyo.kind({
name: "GenericConnectionChecker",
name: "ConnectionChecker",
kind: enyo.Component,
checkConnection: function(onSuccess, onFail) {
......@@ -75,7 +75,7 @@ enyo.kind({
});
enyo.kind({
name: "GenericPowerManager",
name: "PowerManager",
kind: enyo.Component,
enterActivity: function() {
......@@ -86,7 +86,7 @@ enyo.kind({
});
enyo.kind({
name: "GenericApplicationEvents",
name: "ApplicationEvents",
kind: enyo.Component,
events: {
......@@ -105,13 +105,7 @@ enyo.kind({
}
});
function applyGenericHandlers() {
function applyOSSpecific() {
// Unknown host OS/browser
enyo.log("OSSPECIFIC> Using generic handlers; platform unkown/unsupported or running in browser");
window.AppHelper = window.GenericAppHelper;
window.Timer = window.GenericTimer;
window.ConnectionChecker = window.GenericConnectionChecker;
window.PowerManager = window.GenericPowerManager;
window.Database = window.IndexedDB;
window.ApplicationEvents = window.GenericApplicationEvents;
}
\ No newline at end of file
enyo.depends("generic.js", "../../source/logic/database.js", "../../source");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment