Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cordeliaze/cesium
  • pfouque06/cesium
  • wellno1/cesium
  • 1000i100/cesium
  • vincentux/cesium
  • calbasi/cesium
  • thomasbromehead/cesium
  • matograine/cesium
  • clients/cesium-grp/cesium
  • cedricmenec/cesium
  • Pamplemousse/cesium
  • etienneleba/cesium
  • tnntwister/cesium
  • scanlegentil/cesium
  • morvanc/cesium
  • yyy/cesium
  • Axce/cesium
  • Bertrandbenj/cesium
  • Lupus/cesium
  • elmau/cesium
  • MartinDelille/cesium
  • tykayn/cesium
  • numeropi/cesium
  • Vivakvo/cesium
  • pokapow/cesium
  • pini-gh/cesium
  • anam/cesium
  • RavanH/cesium
  • bpresles/cesium
  • am97/cesium
  • tuxmain/cesium
  • jytou/cesium
  • oliviermaurice/cesium
  • 666titi999/cesium
  • Yvv/cesium
35 results
Show changes
Showing
with 1364 additions and 1387 deletions
......@@ -414,13 +414,13 @@ La communauté AngularJS est très active : de nombreux plugins, de tous genres,
Généralement, installer un nouveau plugin AngularJS est très simple. Il suffit d'executer la commande suivante pour que le téléchargement de la librairie soit fait :
```bash
> bower install <nom_du_plugin_AngularJS>
> bower install ---save <nom_du_plugin_AngularJS>
```
Le chemin de la librairie installée doit ensuite être ajouté à la main, dans le fichier `www/index.html` :
Le chemin de la librairie installée doit ensuite être ajouté à la main, dans le fichier `www/index.html`. Par exemple: :
```html
<script src="lib/ionic/js/angular/angular-file-saver.bundle.js"></script>
<script src="lib/angular-file-saver/dist/dist/angular-file-saver.bundle.js"></script>
```
### 5 minutes de dev : Top chrono !
......
File deleted
## Privacy policy
Android build allow user to upload user profile (avatar, pictures) used by the Cesium+ extension.
Cesium Android allow user to upload user profile (avatar, pictures), when the Cesium+ extension has been enable in settings.
### Cesium+ profile
Privacy policy are :
- Profile data and avatar are public data;
- Profile data and avatar on an [ES Duniter4j node](https://github.com/duniter/duniter4j); Open Cesium+ settings to known the node address;
- To totally remove your profile and avatar (if you use our official server [data.gtest.duniter.fr](http://data.gtest.duniter.fr)), please contact us at https://github.com/blavenie.
\ No newline at end of file
- Profile data and avatar on an [Cesium+ node](https://github.com/duniter/cesium-plus-pod); Open Cesium+ settings to know the node address;
- User can remove profile and avatar (open the Settings page, then use the options menu).
\ No newline at end of file
#!/bin/bash
### Control that the script is run on `dev` branch
branch=`git rev-parse --abbrev-ref HEAD`
if [[ ! "$branch" = "master" ]];
then
echo ">> This script must be run under \`master\` branch"
exit -1
fi
### Releasing
current=`grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -oP "\d+.\d+.\d+(\w*)"`
echo "Current version: $current"
### Get repo URL
REPO="duniter/cesium"
REPO_URL=https://api.github.com/repos/$REPO
### get auth token
GITHUB_TOKEN=`cat ~/.config/duniter/.github`
if [[ "_$GITHUB_TOKEN" != "_" ]]; then
GITHUT_AUTH="Authorization: token $GITHUB_TOKEN"
else
echo "Unable to find github authentifcation token file: "
echo " - You can create such a token at https://github.com/settings/tokens > 'Generate a new token'."
echo " - Then copy the token and paste it in the file '~/.config/duniter/.github' using a valid token."
exit -1
fi
case "$1" in
del)
result=`curl -i "$REPO_URL/releases/tags/v$current"`
release_url=`echo "$result" | grep -P "\"url\": \"[^\"]+" | grep -oP "$REPO_URL/releases/\d+"`
if [[ $release_url != "" ]]; then
echo "Deleting existing release..."
curl -H 'Authorization: token $GITHUB_TOKEN' -XDELETE $release_url
fi
;;
pre|rel)
if [[ $2 != "" ]]; then
if [[ $1 = "pre" ]]; then
prerelease="true"
else
prerelease="false"
fi
description="$2"
result=`curl -s -H ''"$GITHUT_AUTH"'' "$REPO_URL/releases/tags/v$current"`
release_url=`echo "$result" | grep -P "\"url\": \"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+/releases/\d+"`
if [[ $release_url != "" ]]; then
echo "Deleting existing release..."
result=`curl -H ''"$GITHUT_AUTH"'' -XDELETE $release_url`
if [[ "_$result" != "_" ]]; then
error_message=`echo "$result" | grep -P "\"message\": \"[^\"]+" | grep -oP ": \"[^\"]+\""`
echo "Delete existing release failed with error$error_message"
exit -1
fi
else
echo "Release not exists yet on github."
fi
echo "Creating new release..."
echo " - tag: v$current"
echo " - description: $description"
result=`curl -H ''"$GITHUT_AUTH"'' -i $REPO_URL/releases -d '{"tag_name": "v'"$current"'","target_commitish": "master","name": "'"$current"'","body": "'"$description"'","draft": false,"prerelease": '"$prerelease"'}'`
#echo "DEBUG - $result"
upload_url=`echo "$result" | grep -P "\"upload_url\": \"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+"`
### Sending files
echo "Uploading files to $upload_url"
dirname=`pwd`
curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/zip' -T $dirname/platforms/web/build/cesium-v$current-web.zip $upload_url?name=cesium-v$current-web.zip
curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/vnd.android.package-archive' -T $dirname/platforms/android/build/outputs/apk/release/android-release.apk $upload_url?name=cesium-v$current-android.apk
echo "Successfully uploading files"
echo " -> Release url: https://github.com/$REPO/releases/tag/v$current"
else
echo "Wrong arguments"
echo "Usage:"
echo " > ./github.sh pre|rel <release_description>"
echo "With:"
echo " - pre: use for pre-release"
echo " - rel: for full release"
exit -1
fi
;;
*)
echo "No task given"
exit -1
;;
esac
This diff is collapsed.
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Cordova Hooks
This directory may contain scripts used to customize cordova commands. This
directory used to exist at `.cordova/hooks`, but has now been moved to the
project root. Any scripts you add to these directories will be executed before
and after the commands corresponding to the directory name. Useful for
integrating your own build systems or integrating with version control systems.
__Remember__: Make your scripts executable.
## Hook Directories
The following subdirectories will be used for hooks:
after_build/
after_compile/
after_docs/
after_emulate/
after_platform_add/
after_platform_rm/
after_platform_ls/
after_plugin_add/
after_plugin_ls/
after_plugin_rm/
after_plugin_search/
after_prepare/
after_run/
after_serve/
before_build/
before_compile/
before_docs/
before_emulate/
before_platform_add/
before_platform_rm/
before_platform_ls/
before_plugin_add/
before_plugin_ls/
before_plugin_rm/
before_plugin_search/
before_prepare/
before_run/
before_serve/
pre_package/ <-- Windows 8 and Windows Phone only.
## Script Interface
All scripts are run from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:
* CORDOVA_VERSION - The version of the Cordova-CLI.
* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios).
* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer)
* CORDOVA_HOOK - Path to the hook that is being executed.
* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate)
If a script returns a non-zero exit code, then the parent cordova command will be aborted.
## Writing hooks
We highly recommend writting your hooks using Node.js so that they are
cross-platform. Some good examples are shown here:
[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var gutil = require('gulp-util');
var path = require("path");
var cmd = process.env.CORDOVA_CMDLINE;
var rootdir = process.argv[2];
var argv = require('yargs').argv;
var skip = true;
if (/*cmd.indexOf("--release") > -1 || */cmd.indexOf("--playstore") > -1) {
skip = false;
}
if (rootdir && !skip) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
var platformRoot = path.join(rootdir, 'platforms', platform);
// Deploy for Android
if(platform == 'android') {
var apkFileLocation = path.join(platformRoot, 'build/outputs/apk/android-release.apk');
console.log('Publishing APK file [' + apkFileLocation + '] to playstore...');
var config = require('../playstore-config.json');
if(!config) {
gutil.log(gutil.colors.red("ERROR => Could not load `hooks/playstore-config.json` file!"));
return;
}
if(!config.client_email || !config.private_key) {
gutil.log(gutil.colors.red("ERROR => Could not found 'client_email' or 'private_key' in 'hooks/playstore-config.json' file."));
return;
}
var publisher = require('playup')(config);
publisher.upload(apkFileLocation,
{
track: 'production',
recentChanges: {
'fr-FR': 'New stable release'
}
})
.then(function (data) {
console.log(' > APK file successfully deployed to Playstore !');
})
.catch(function(err) {
console.log('ERROR while publsihing to playtore: \n' + err);
})
}
else {
// TODO : deploy other for platforms
}
}
}
#!/usr/bin/env node
// Add Platform Class
// v1.0
// Automatically adds the platform class to the body tag
// after the `prepare` command. By placing the platform CSS classes
// directly in the HTML built for the platform, it speeds up
// rendering the correct layout/style for the specific platform
// instead of waiting for the JS to figure out the correct classes.
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];
function addPlatformBodyTag(indexPath, platform) {
// add the platform class to the body tag
try {
var platformClass = 'platform-' + platform;
var cordovaClass = 'platform-cordova platform-webview';
var html = fs.readFileSync(indexPath, 'utf8');
var bodyTag = findBodyTag(html);
if(!bodyTag) return; // no opening body tag, something's wrong
if(bodyTag.indexOf(platformClass) > -1) return; // already added
var newBodyTag = bodyTag;
var classAttr = findClassAttr(bodyTag);
if(classAttr) {
// body tag has existing class attribute, add the classname
var endingQuote = classAttr.substring(classAttr.length-1);
var newClassAttr = classAttr.substring(0, classAttr.length-1);
newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote;
newBodyTag = bodyTag.replace(classAttr, newClassAttr);
} else {
// add class attribute to the body tag
newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">');
}
html = html.replace(bodyTag, newBodyTag);
fs.writeFileSync(indexPath, html, 'utf8');
process.stdout.write('add to body class: ' + platformClass + '\n');
} catch(e) {
process.stdout.write(e);
}
}
function findBodyTag(html) {
// get the body tag
try{
return html.match(/<body(?=[\s>])(.*?)>/gi)[0];
}catch(e){}
}
function findClassAttr(bodyTag) {
// get the body tag's class attribute
try{
return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0];
}catch(e){}
}
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
// open up the index.html file at the www root
try {
var platform = platforms[x].trim().toLowerCase();
var indexPath;
if(platform == 'android') {
indexPath = path.join('platforms', platform, 'assets', 'www', 'index.html');
} else {
indexPath = path.join('platforms', platform, 'www', 'index.html');
}
if(fs.existsSync(indexPath)) {
addPlatformBodyTag(indexPath, platform);
}
} catch(e) {
process.stdout.write(e);
}
}
}
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var removeCode = require('gulp-remove-code');
var removeHtml = require('gulp-html-remove');
var es = require('event-stream');
var ngAnnotate = require('gulp-ng-annotate');
var htmlmin = require('gulp-htmlmin');
var rootdir = process.argv[2];
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
var wwwPath;
if(platform == 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
}
var pluginPath = path.join(wwwPath, 'plugins') + '/es';
// Log
//console.log('['+process.mainModule.filename+'] Removing code for platform '+platform+'\n');
// Compute options {device-<platform>: true}
var platformRemoveCodeOptions = {};
platformRemoveCodeOptions[platform] = true; // = {<platform>: true}
var htmlminOptions = {removeComments: true, collapseWhitespace: true};
// Removing unused code for device...
es.concat(
// Remove unused HTML tags
gulp.src(path.join(wwwPath, 'templates', '**', '*.html'))
.pipe(removeCode({device: true}))
.pipe(removeCode(platformRemoveCodeOptions))
.pipe(removeHtml('.hidden-xs.hidden-sm'))
.pipe(removeHtml('.hidden-device'))
.pipe(removeHtml('[remove-if][remove-if="device"]'))
.pipe(htmlmin(htmlminOptions))
.pipe(gulp.dest(wwwPath + '/templates')),
gulp.src(path.join(pluginPath, '**', '*.html'))
.pipe(removeCode({device: true}))
.pipe(removeCode(platformRemoveCodeOptions))
.pipe(removeHtml('.hidden-xs.hidden-sm'))
.pipe(removeHtml('.hidden-device'))
.pipe(removeHtml('[remove-if][remove-if="device"]'))
.pipe(htmlmin(htmlminOptions))
.pipe(gulp.dest(pluginPath)),
gulp.src(path.join(wwwPath, 'index.html'))
.pipe(removeCode({device: true}))
.pipe(removeCode(platformRemoveCodeOptions))
.pipe(removeHtml('.hidden-xs.hidden-sm'))
.pipe(removeHtml('.hidden-device'))
.pipe(removeHtml('[remove-if][remove-if="device"]'))
.pipe(htmlmin(/*no options, to build comments*/))
.pipe(gulp.dest(wwwPath)),
// Remove unused JS code + add ng annotations
gulp.src(path.join(wwwPath, 'js', '**', '*.js'))
.pipe(removeCode({device: true}))
.pipe(removeCode(platformRemoveCodeOptions))
.pipe(ngAnnotate({single_quotes: true}))
.pipe(gulp.dest(wwwPath + '/dist/dist_js/app')),
gulp.src([pluginPath + '/js/**/*.js'])
.pipe(removeCode({device: true}))
.pipe(removeCode(platformRemoveCodeOptions))
.pipe(ngAnnotate({single_quotes: true}))
.pipe(gulp.dest(wwwPath + '/dist/dist_js/plugins'))
);
}
}
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var templateCache = require('gulp-angular-templatecache');
var es = require('event-stream');
var rootdir = process.argv[2];
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
var wwwPath;
if(platform == 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
}
var distJsPath = path.join(wwwPath, 'dist', 'dist_js', 'app');
var pluginDistJsPath = path.join(wwwPath, 'dist', 'dist_js', 'plugins');
// Concat templates into a JS
es.concat(
gulp.src(path.join(wwwPath, 'templates', '**', '*.html'))
.pipe(templateCache({
standalone:true,
module:"cesium.templates",
root: "templates/"
}))
.pipe(gulp.dest(distJsPath)),
gulp.src(path.join(wwwPath, 'plugins', '*', 'templates', '**', '*.html'))
.pipe(templateCache({
standalone:true,
module:"cesium.plugins.templates",
root: "plugins/"
}))
.pipe(gulp.dest(pluginDistJsPath))
);
}
}
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var es = require('event-stream');
var rootdir = process.argv[2];
var ngTranslate = require('gulp-angular-translate');
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
var wwwPath;
if(platform == 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
}
var distJsPath = path.join(wwwPath, 'dist', 'dist_js', 'app');
var pluginDistJsPath = path.join(wwwPath, 'dist', 'dist_js', 'plugins');
// Concat templates into a JS
es.concat(
gulp.src(wwwPath + '/i18n/locale-*.json')
.pipe(ngTranslate({standalone:true, module: 'cesium.translations'}))
.pipe(gulp.dest(distJsPath)),
gulp.src(wwwPath + '/plugins/*/i18n/locale-*.json')
.pipe(ngTranslate({standalone:true, module: 'cesium.plugins.translations'}))
.pipe(gulp.dest(pluginDistJsPath))
);
}
}
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var es = require('event-stream');
var useref = require('gulp-useref');
var filter = require('gulp-filter');
var uglify = require('gulp-uglify');
var csso = require('gulp-csso');
var rev = require('gulp-rev');
var revReplace = require('gulp-rev-replace');
var cmd = process.env.CORDOVA_CMDLINE;
var rootdir = process.argv[2];
var skip = true;
if (cmd.indexOf("--release") > -1 || cmd.indexOf("--useref") > -1) {
skip = false;
}
if (rootdir && !skip) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
var wwwPath;
if(platform == 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
}
var indexPath = path.join(wwwPath, 'index.html');
var jsFilter = filter(["**/*.js", "!**/vendor/*", '!**/config.js'], { restore: true });
var cssFilter = filter("**/*.css", { restore: true });
var revFilesFilter = filter(['**/*', '!**/index.html', '!**/config.js'], { restore: true });
var uglifyOptions = {beautify: false};
// Removing unused code for device...
es.concat(
gulp.src(indexPath)
.pipe(useref()) // Concatenate with gulp-useref
.pipe(jsFilter)
.pipe(uglify(uglifyOptions)) // Minify any javascript sources
.pipe(jsFilter.restore)
.pipe(cssFilter)
.pipe(csso()) // Minify any CSS sources
.pipe(cssFilter.restore)
.pipe(revFilesFilter)
.pipe(rev()) // Rename the concatenated files (but not index.html)
.pipe(revFilesFilter.restore)
.pipe(revReplace()) // Substitute in new filenames
.pipe(gulp.dest(wwwPath))
);
}
}
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var gutil = require('gulp-util');
var allConfig = require('../../app/config.json');
var path = require("path");
var del = require('del');
var cmd = process.env.CORDOVA_CMDLINE;
var rootdir = process.argv[2];
var argv = require('yargs').argv;
var skip = true;
if (cmd.indexOf("--release") > -1 || cmd.indexOf("--useref") > -1) {
skip = false;
}
if (rootdir && !skip) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
var wwwPath;
if(platform == 'android') {
wwwPath = path.join(rootdir, 'platforms', platform, 'assets', 'www');
} else {
wwwPath = path.join(rootdir, 'platforms', platform, 'www');
}
// Log
//console.log('['+process.mainModule.filename+'] Cleaning unused directories');
// Clean unused directories
del([
path.join(wwwPath, 'i18n'),
path.join(wwwPath, 'js'),
path.join(wwwPath, 'templates'),
path.join(wwwPath, 'css'),
path.join(wwwPath, 'dist'),
path.join(wwwPath, 'js'),
path.join(wwwPath, 'cordova-js-src'),
path.join(wwwPath, 'plugins', 'es'),
path.join(wwwPath, 'plugins', 'graph'),
path.join(wwwPath, 'plugins', 'map'),
path.join(wwwPath, 'plugins', 'rml9'),
path.join(wwwPath, 'lib', '**'),
// Keep Ionic lib/ionic/fonts directory
'!'+path.join(wwwPath, 'lib'),
'!'+path.join(wwwPath, 'lib', 'ionic'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', '**'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Black'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Black', '**'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Bold'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Bold', '**'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'BoldItalic'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'BoldItalic', '**'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Italic'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Italic', '**'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Light'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Light', '**'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Medium'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Medium', '**'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Regular'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Regular', '**'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Thin'),
'!'+path.join(wwwPath, 'lib', 'ionic', 'fonts', 'robotdraft', 'Thin', '**')
]);
}
}
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var replace = require('gulp-replace');
var rootdir = process.argv[2];
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
if(platform == 'android') {
var platformPath = path.join(rootdir, 'platforms', platform);
var androidManifestFile = path.join(platformPath, 'AndroidManifest.xml');
// Clean unused directories
console.log('-----------------------------------------');
console.log(' Updating file: ' + androidManifestFile);
gulp.src(androidManifestFile)
// Add 'tools' namespace to root tag
.pipe(replace(/(xmlns:android="http:\/\/schemas.android.com\/apk\/res\/android")\s*>/g, '$1 xmlns:tools="http://schemas.android.com/tools">'))
// remove all <uses-sdk>
.pipe(replace(/<uses-sdk [^>]+\/>/g, ''))
// add <uses-sdk> (replace 'targetSdkversion' and add tools:overrideLibrary)
.pipe(replace(/(<\/manifest>)/, ' <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" tools:overrideLibrary="org.kaliumjni.lib" />\n$1'))
.pipe(gulp.dest(platformPath));
console.log('-----------------------------------------');
}
}
}
#!/usr/bin/env node
"use strict";
var fs = require('fs');
var glob = require('glob');
var path = require('path')
// See: https://stackoverflow.com/questions/49162538/running-cordova-build-android-unable-to-find-attribute-androidfontvariation
var rootdir = process.argv[2];
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for (var x = 0; x < platforms.length; x++) {
try {
var platform = platforms[x].trim().toLowerCase();
if (platform == 'android') {
var build_dir = rootdir + '/resources/android/build';
var android_dir = rootdir + '/platforms/android';
var build_files = build_dir + '/**/*.*';
console.log('-----------------------------------------');
if (fs.existsSync(android_dir) && fs.existsSync(build_dir)) {
var mkdirp = function(dir) {
var parent = path.dirname(dir);
if (!fs.existsSync(parent)){
mkdirp(parent);
}
if (!fs.existsSync(dir)){
fs.mkdirSync(dir);
}
};
glob(build_files, null, function(er, files) {
files.forEach(function(file) {
console.log(' Copy ' + file + ' to ' + android_dir);
var dest_file = file.replace(build_dir, android_dir);
mkdirp(path.dirname(dest_file));
fs.createReadStream(file).pipe(fs.createWriteStream(dest_file));
});
});
var gradle_file = build_dir + '/build-extras.gradle';
if (!fs.existsSync(gradle_file)) {
console.log( ' File ' + gradle_file + ' not found. Skipping copy to /platforms/android');
}
var signing_file = build_dir + '/release-signing.properties';
if (!fs.existsSync(signing_file)) {
console.log( ' File ' + signing_file + ' not found. Skipping copy to /platforms/android');
console.log( ' WARNING: Release APK files will not be signed !');
}
} else {
console.log( ' Directory ' + build_dir + ' not found. Skipping copy to /platforms/android');
}
console.log('-----------------------------------------');
}
} catch (e) {
process.stdout.write(e);
}
}
}
#!/usr/bin/env node
"use strict";
var gulp = require('gulp');
var path = require("path");
var replace = require('gulp-replace');
var rootdir = process.argv[2];
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
var platform = platforms[x].trim().toLowerCase();
if(platform == 'ubuntu') {
var platformPath = path.join(rootdir, 'platforms', platform);
var ionicConfigFile = path.join(platformPath, 'config.xml');
// Clean unused directories
console.log('-----------------------------------------');
console.log(' Updating file: ' + ionicConfigFile);
gulp.src(ionicConfigFile)
// change App ID into 'duniter-cesium'
.pipe(replace(/id="fr.duniter.cesium"/g, 'id="cesium"'))
.pipe(gulp.dest(platformPath));
console.log('-----------------------------------------');
}
}
}
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var jshint = require('jshint').JSHINT;
var async = require('async');
var foldersToProcess = [
'js',
'js/controllers',
'js/entities',
'js/services',
'plugins/es/js',
'plugins/es/js/controllers',
'plugins/es/js/entities',
'plugins/es/js/services'
];
foldersToProcess.forEach(function(folder) {
processFiles("www/" + folder);
});
function processFiles(dir, callback) {
var errorCount = 0;
fs.readdir(dir, function(err, list) {
if (err) {
console.log('processFiles err: ' + err);
return;
}
async.eachSeries(list, function(file, innercallback) {
file = dir + '/' + file;
fs.stat(file, function(err, stat) {
if(!stat.isDirectory()) {
if(path.extname(file) === ".js") {
lintFile(file, function(hasError) {
if(hasError) {
errorCount++;
}
innercallback();
});
} else {
innercallback();
}
} else {
innercallback();
}
});
}, function(error) {
if(errorCount > 0) {
process.exit(1);
}
});
});
}
function lintFile(file, callback) {
console.log("Linting '" + file + "'");
fs.readFile(file, function(err, data) {
if(err) {
console.error('Error: ' + err);
return;
}
if(jshint(data.toString())) {
//console.log('File ' + file + ' has no errors.');
//console.log('-----------------------------------------');
callback(false);
} else {
console.error("Errors in file '" + file + "':");
var out = jshint.data(),
errors = out.errors;
for(var j = 0; j < errors.length; j++) {
console.error( " Line " + errors[j].line + ':' + errors[j].character + ' -> ' + errors[j].reason + ' -> ' +
errors[j].evidence);
}
console.log('-----------------------------------------');
callback(true);
}
});
}
......@@ -6,16 +6,10 @@ is_installed() {
type "$1" > /dev/null 2>&1
}
if [ "_$1" != "_" ]; then
CESIUM_DIR="$1"
fi
if [ "_$CESIUM_DIR" = "_" ]; then
DIRNAME=`pwd`
CESIUM_DIR="$DIRNAME/cesium"
fi
CESIUM_DIR=${1:-$(pwd)/cesium}
latest_version() {
echo "v1.4.2" #lastest
echo "v1.7.13" # lastest
}
api_release_url() {
......@@ -39,40 +33,39 @@ download() {
install_from_github() {
local RELEASE=`curl -XGET -i $(api_release_url)`
local CESIUM_URL=`echo "$RELEASE" | grep -P "\"browser_download_url\": \"[^\"]+" | grep -oP "https://[a-zA-Z0-9/.-]+-web.zip"`
local CESIUM_ARCHIVE=$CESIUM_DIR/cesium.zip
if [ -d "$CESIUM_DIR" ]; then
if [ -f "$CESIUM_ARCHIVE" ]; then
echo "WARNING: Deleting existing archive [$CESIUM_ARCHIVE]"
rm $CESIUM_ARCHIVE
fi
else
local RELEASE=$(curl -XGET -i "$(api_release_url)")
local CESIUM_URL=$(echo "$RELEASE" | grep -P '"browser_download_url": "[^"]+' | grep -oP "https://[a-zA-Z0-9/.-]+-web.zip" | head -n 1)
local CESIUM_ARCHIVE="$CESIUM_DIR/cesium.zip"
if [ ! -d "$CESIUM_DIR" ]; then
mkdir -p "$CESIUM_DIR"
elif [ -f "$CESIUM_ARCHIVE" ]; then
echo "WARNING: Deleting existing archive [$CESIUM_ARCHIVE]"
rm "$CESIUM_ARCHIVE"
fi
echo "Downloading [$CESIUM_URL]"
download "$CESIUM_URL" -o "$CESIUM_ARCHIVE" || {
echo >&2 "Failed to download '$CESIUM_URL'"
return 4
}
echo "Unarchive to $CESIUM_DIR"
unzip -o $CESIUM_ARCHIVE -d $CESIUM_DIR
rm $CESIUM_ARCHIVE
echo >&2 "Failed to download '$CESIUM_URL'"
return 4
}
echo
echo "Unarchiving to $CESIUM_DIR"
unzip -o "$CESIUM_ARCHIVE" -d "$CESIUM_DIR"
rm "$CESIUM_ARCHIVE"
echo "Cesium successfully installed at $CESIUM_DIR"
}
do_install() {
if ! is_installed "curl"; then
echo "=> curl is not available. You will likely need to install 'curl' package."
if ! is_installed "curl" && ! is_installed "wget"; then
echo "=> Neither 'curl' nor 'wget' is available. Please install one of them."
exit 1
fi
if ! is_installed "unzip"; then
echo "=> unzip is not available. You will likely need to install 'unzip' package."
echo "=> 'unzip' is not available. You will likely need to install the 'unzip' package."
exit 1
fi
......@@ -84,10 +77,9 @@ do_install() {
# during the execution of the install script
#
reset() {
unset -f reset is_installed latest_version \
download install_from_github do_install
unset -f reset is_installed latest_version api_release_url download install_from_github do_install
}
[ "_$CESIUM_ENV" = "_testing" ] || do_install $1
[ "_$CESIUM_ENV" = "_testing" ] || do_install "$1"
} # this ensures the entire script is downloaded #
{
"name": "Cesium",
"type": "ionic1",
"integrations": {
"cordova": {}
},
"type": "ionic1",
"watchPatterns": [
"www/index.html",
"www/dist/**/*",
"www/css/*.css"
],
"yarn": true
}
{
"name": "Cesium",
"app_id": "",
"watchPatterns": [
"www/**/*",
"!www/dist/**/*",
"!www/lib/**/*",
"!www/css/*.app.css"
],
"gulpStartupTasks": [
"serve:before",
"watch"
],
"defaultBrowser": "chrome",
"browsers": [
{
"platform": "android",
"browser": "crosswalk",
"version": "12.41.296.5"
}
]
}
\ No newline at end of file