Skip to content

Commit

Permalink
Merge pull request #1061 from moodlehq/integration
Browse files Browse the repository at this point in the history
Integration
  • Loading branch information
jleyva authored May 26, 2017
2 parents 97bb648 + ae9ead2 commit d9cad42
Show file tree
Hide file tree
Showing 1,006 changed files with 27,762 additions and 4,182 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ addons:
language: node_js

node_js:
- '0.12'
- '6.9.1'

before_install:
- npm cache clean
Expand Down
26 changes: 13 additions & 13 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"private": "true",
"devDependencies": {
"ionic": "1.3.2",
"ydn.db": ">=1.0.3",
"ngCordova": ">=0.1.24-alpha",
"ydn.db": "1.0.3",
"angular-mocks": "1.5.3",
"angular-md5": "0.1.8",
"angular-translate": "~2.13.0",
"angular-translate-loader-partial": "~2.13.0",
"angular-aria": "1.5.3",
"moment": "~2.10.6",
"jszip": "~2.5.0",
"oclazyload": "~1.0.9",
"ckeditor": "=4.5.9",
"angular-ckeditor": "=1.0.3",
"angular-messages": "1.5.3"
"angular-messages": "1.5.3",
"ckeditor": "4.5.9",
"angular-ckeditor": "1.0.3",
"ngCordova": "^0.1.26-alpha",
"angular-md5": "^0.1.8",
"angular-translate": "^2.13.0",
"angular-translate-loader-partial": "^2.13.0",
"moment": "^2.10.6",
"jszip": "^2.5.0",
"oclazyload": "^1.0.9",
"chart.js": "^2.4.0",
"angular-chart.js": "^1.0.2"
},
"resolutions": {
"angular": "1.5.3"
},
"dependencies": {
"chart.js": "^2.4.0",
"angular-chart.js": "^1.0.2"
}
}
5 changes: 4 additions & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.moodle.moodlemobile" version="3.2.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.moodle.moodlemobile" version="3.3.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Moodle Mobile</name>
<description>Official Moodle Mobile app</description>
<author href="http://moodle.com" email="juan@moodle.com">Juan Leyva</author>
Expand All @@ -17,6 +17,9 @@
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<preference name="KeyboardDisplayRequiresUserAction" value="false"/>
<preference name="android-minSdkVersion" value="14" />
<preference name="android-targetSdkVersion" value="19" />
<preference name="AppendUserAgent" value="MoodleMobile" />
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
Expand Down
56 changes: 53 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var stripComments = require('gulp-strip-comments');
var removeEmptyLines = require('gulp-remove-empty-lines');
var clipEmptyFiles = require('gulp-clip-empty-files');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var cleanCSS = require('gulp-clean-css');
var rename = require('gulp-rename');
var tap = require('gulp-tap');
var fs = require('fs');
Expand All @@ -19,6 +19,7 @@ var gulpSlash = require('gulp-slash');
var ngAnnotate = require('gulp-ng-annotate');
var yargs = require('yargs');
var zip = require('gulp-zip');
var clean = require('gulp-clean');

// Given a list of paths to search and the path to an addon, return the list of paths to search only inside the addon folder.
function getRemoteAddonPaths(paths, pathToAddon) {
Expand Down Expand Up @@ -334,6 +335,7 @@ var paths = {
],
sass: {
core: [
'./www/core/scss/styles.scss',
'./www/core/scss/*.scss',
'./www/core/components/**/scss/*.scss',
'./www/addons/**/scss/*.scss',
Expand Down Expand Up @@ -408,7 +410,7 @@ gulp.task('sass', ['sass-build'], function(done) {
.pipe(concat('mm.bundle.css'))
.pipe(sass())
.pipe(gulp.dest(paths.build))
.pipe(minifyCss({
.pipe(cleanCSS({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
Expand Down Expand Up @@ -758,14 +760,17 @@ gulp.task('remoteaddon-build', ['remoteaddon-copy'], function(done) {
pathToReplace = newYargs.argv.jspath;
if (typeof pathToReplace == 'undefined') {
if (path.indexOf('www') === 0) {
pathToReplace = path.replace('www/', '');
pathToReplace = path.replace(/www[\/\\]/, '');
} else {
pathToReplace = path;
}
}

jsPaths = getRemoteAddonPaths(remoteAddonPaths.js, path);

// Convert all backslash (\) to slash (/) to make it work in Windows.
pathToReplace = pathToReplace.replace(/\\/g, '/');

if (pathToReplace.slice(-1) == '/') {
wildcard = wildcard + '/';
}
Expand Down Expand Up @@ -894,3 +899,48 @@ gulp.task('remoteaddon', ['remoteaddon-build', 'remoteaddon-sass', 'remoteaddon-
done();
});
});

// Cleans the development environment by deleting downloaded files and libraries
gulp.task('clean-libs', ['clean-www-libs', 'clean-ionic-platforms', 'clean-e2e-build', 'clean-sass-cache', 'clean-ionic-plugins']);

// Removes the contents in the /www/lib/ directory
gulp.task('clean-www-libs', function() {
return gulp.src('www/lib/', {read: false})
.pipe(clean());
});

// Removes the contents in the /platforms directory
gulp.task('clean-ionic-platforms', function() {
return gulp.src('platforms/', {read: false})
.pipe(clean());
});

// Removes the contents in the /plugins directory
gulp.task('clean-ionic-plugins', function() {
return gulp.src('plugins/', {read: false})
.pipe(clean());
});

// Removes the contents in the /www/build directory
gulp.task('clean-build', function() {
return gulp.src('www/build/', {read: false})
.pipe(clean());
});

// Removes the contents in the /e2e/build directory
gulp.task('clean-e2e-build', function() {
return gulp.src('e2e/build/', {read: false})
.pipe(clean());
});

// Removes the contents in the /.sass-cache directory
gulp.task('clean-sass-cache', function() {
return gulp.src('.sass-cache/', {read: false})
.pipe(clean());
});

// Removes the contents in the /node-modules directory
gulp.task('clean-node-modules', function() {
return gulp.src('node_modules/', {read: false})
.pipe(clean());
});
10 changes: 10 additions & 0 deletions ionic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "moodlemobile2",
"app_id": "",
"watchPatterns": [
"www/**/*.html",
"www/build/**/*",
"www/index.html",
"!www/lib/**/*"
]
}
2 changes: 1 addition & 1 deletion ionic.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mm2",
"name": "moodlemobile2",
"app_id": "",
"gulpStartupTasks": [
"build",
Expand Down
75 changes: 55 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
{
"name": "mm2",
"version": "1.0.0",
"description": "mm2: An Ionic project",
"description": "Moodle Mobile 2: The official mobile app for Moodle.",
"repository": {
"type": "git",
"url": "https://github.com/moodlehq/moodlemobile2.git"
},
"license": "Apache-2.0",
"licenses": [
{
"type": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"dependencies": {
"gulp": "^3.5.6",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^1.3.3"
},
"devDependencies": {
"appium": "^1.4.11",
"appium": "^1.6.0",
"bower": "^1.3.3",
"gulp": "^3.9.1",
"gulp-clean-css": "^3.0.3",
"gulp-concat": "^2.6.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^2.3.2",
"gulp-clean": "^0.3.2",
"gulp-clip-empty-files": "^0.1.1",
"gulp-concat-util": "^0.5.2",
"gulp-file": "^0.2.0",
"gulp-insert": "^0.4.0",
"gulp-ng-annotate": "^1.1.0",
"gulp-remove-empty-lines": "0.0.2",
"gulp-file": "^0.3.0",
"gulp-insert": "^0.5.0",
"gulp-ng-annotate": "^2.0.0",
"gulp-remove-empty-lines": "0.0.8",
"gulp-slash": "^1.1.3",
"gulp-strip-comments": "^1.0.1",
"gulp-strip-comments": "^2.4.3",
"gulp-tap": "^0.1.3",
"gulp-util": "^2.2.14",
"gulp-util": "^3.0.7",
"gulp-zip": "^3.2.0",
"jasmine": "^2.2.1",
"jasmine-core": "^2.2.0",
"karma": "^0.12.31",
"karma-chrome-launcher": "^0.1.7",
"karma-jasmine": "^0.3.5",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-jasmine": "^1.0.2",
"plist": "^1.1.0",
"protractor": "^2.2.0",
"protractor": "^4.0.9",
"shelljs": "^0.3.0",
"through": "^2.3.6",
"wd": "^0.4.0",
Expand Down Expand Up @@ -85,7 +97,30 @@
"nl.kingsquare.cordova.background-audio"
],
"cordovaPlatforms": [
"ios",
"android"
]
{
"platform": "ios",
"version": "4.3.0",
"locator": "ios@4.3.0"
},
{
"platform": "android",
"version": "6.1.2",
"locator": "android@6.1.2"
}
],
"scripts": {
"setup": "npm install && ionic state restore && bower install && gulp",
"reinstall": "gulp clean-build && gulp clean-libs && gulp clean-node-modules && npm run-script setup",
"start": "ionic serve",
"clean": "gulp clean-build",
"build.e2e": "gulp e2e-build",
"build.dev": "gulp",
"build.android": "ionic build android",
"build.ios": "ionic build ios",
"ios": "ionic run ios",
"android": "ionic run android",
"serve.e2e": "ionic serve -b -a",
"serve.dev": "ionic serve",
"e2e": "protractor e2e/build/protractor.conf.js"
}
}
Loading

0 comments on commit d9cad42

Please sign in to comment.