Skip to content

Commit d9cad42

Browse files
authored
Merge pull request #1061 from moodlehq/integration
Integration
2 parents 97bb648 + ae9ead2 commit d9cad42

File tree

1,006 files changed

+27762
-4182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,006 files changed

+27762
-4182
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ addons:
1313
language: node_js
1414

1515
node_js:
16-
- '0.12'
16+
- '6.9.1'
1717

1818
before_install:
1919
- npm cache clean

bower.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
"private": "true",
44
"devDependencies": {
55
"ionic": "1.3.2",
6-
"ydn.db": ">=1.0.3",
7-
"ngCordova": ">=0.1.24-alpha",
6+
"ydn.db": "1.0.3",
87
"angular-mocks": "1.5.3",
9-
"angular-md5": "0.1.8",
10-
"angular-translate": "~2.13.0",
11-
"angular-translate-loader-partial": "~2.13.0",
128
"angular-aria": "1.5.3",
13-
"moment": "~2.10.6",
14-
"jszip": "~2.5.0",
15-
"oclazyload": "~1.0.9",
16-
"ckeditor": "=4.5.9",
17-
"angular-ckeditor": "=1.0.3",
18-
"angular-messages": "1.5.3"
9+
"angular-messages": "1.5.3",
10+
"ckeditor": "4.5.9",
11+
"angular-ckeditor": "1.0.3",
12+
"ngCordova": "^0.1.26-alpha",
13+
"angular-md5": "^0.1.8",
14+
"angular-translate": "^2.13.0",
15+
"angular-translate-loader-partial": "^2.13.0",
16+
"moment": "^2.10.6",
17+
"jszip": "^2.5.0",
18+
"oclazyload": "^1.0.9",
19+
"chart.js": "^2.4.0",
20+
"angular-chart.js": "^1.0.2"
1921
},
2022
"resolutions": {
2123
"angular": "1.5.3"
2224
},
2325
"dependencies": {
24-
"chart.js": "^2.4.0",
25-
"angular-chart.js": "^1.0.2"
2626
}
2727
}

config.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<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">
2+
<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">
33
<name>Moodle Mobile</name>
44
<description>Official Moodle Mobile app</description>
55
<author href="http://moodle.com" email="[email protected]">Juan Leyva</author>
@@ -17,6 +17,9 @@
1717
<preference name="SplashScreen" value="screen"/>
1818
<preference name="SplashScreenDelay" value="3000"/>
1919
<preference name="KeyboardDisplayRequiresUserAction" value="false"/>
20+
<preference name="android-minSdkVersion" value="14" />
21+
<preference name="android-targetSdkVersion" value="19" />
22+
<preference name="AppendUserAgent" value="MoodleMobile" />
2023
<feature name="StatusBar">
2124
<param name="ios-package" value="CDVStatusBar" onload="true"/>
2225
</feature>

gulpfile.js

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var stripComments = require('gulp-strip-comments');
77
var removeEmptyLines = require('gulp-remove-empty-lines');
88
var clipEmptyFiles = require('gulp-clip-empty-files');
99
var sass = require('gulp-sass');
10-
var minifyCss = require('gulp-minify-css');
10+
var cleanCSS = require('gulp-clean-css');
1111
var rename = require('gulp-rename');
1212
var tap = require('gulp-tap');
1313
var fs = require('fs');
@@ -19,6 +19,7 @@ var gulpSlash = require('gulp-slash');
1919
var ngAnnotate = require('gulp-ng-annotate');
2020
var yargs = require('yargs');
2121
var zip = require('gulp-zip');
22+
var clean = require('gulp-clean');
2223

2324
// 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.
2425
function getRemoteAddonPaths(paths, pathToAddon) {
@@ -334,6 +335,7 @@ var paths = {
334335
],
335336
sass: {
336337
core: [
338+
'./www/core/scss/styles.scss',
337339
'./www/core/scss/*.scss',
338340
'./www/core/components/**/scss/*.scss',
339341
'./www/addons/**/scss/*.scss',
@@ -408,7 +410,7 @@ gulp.task('sass', ['sass-build'], function(done) {
408410
.pipe(concat('mm.bundle.css'))
409411
.pipe(sass())
410412
.pipe(gulp.dest(paths.build))
411-
.pipe(minifyCss({
413+
.pipe(cleanCSS({
412414
keepSpecialComments: 0
413415
}))
414416
.pipe(rename({ extname: '.min.css' }))
@@ -758,14 +760,17 @@ gulp.task('remoteaddon-build', ['remoteaddon-copy'], function(done) {
758760
pathToReplace = newYargs.argv.jspath;
759761
if (typeof pathToReplace == 'undefined') {
760762
if (path.indexOf('www') === 0) {
761-
pathToReplace = path.replace('www/', '');
763+
pathToReplace = path.replace(/www[\/\\]/, '');
762764
} else {
763765
pathToReplace = path;
764766
}
765767
}
766768

767769
jsPaths = getRemoteAddonPaths(remoteAddonPaths.js, path);
768770

771+
// Convert all backslash (\) to slash (/) to make it work in Windows.
772+
pathToReplace = pathToReplace.replace(/\\/g, '/');
773+
769774
if (pathToReplace.slice(-1) == '/') {
770775
wildcard = wildcard + '/';
771776
}
@@ -894,3 +899,48 @@ gulp.task('remoteaddon', ['remoteaddon-build', 'remoteaddon-sass', 'remoteaddon-
894899
done();
895900
});
896901
});
902+
903+
// Cleans the development environment by deleting downloaded files and libraries
904+
gulp.task('clean-libs', ['clean-www-libs', 'clean-ionic-platforms', 'clean-e2e-build', 'clean-sass-cache', 'clean-ionic-plugins']);
905+
906+
// Removes the contents in the /www/lib/ directory
907+
gulp.task('clean-www-libs', function() {
908+
return gulp.src('www/lib/', {read: false})
909+
.pipe(clean());
910+
});
911+
912+
// Removes the contents in the /platforms directory
913+
gulp.task('clean-ionic-platforms', function() {
914+
return gulp.src('platforms/', {read: false})
915+
.pipe(clean());
916+
});
917+
918+
// Removes the contents in the /plugins directory
919+
gulp.task('clean-ionic-plugins', function() {
920+
return gulp.src('plugins/', {read: false})
921+
.pipe(clean());
922+
});
923+
924+
// Removes the contents in the /www/build directory
925+
gulp.task('clean-build', function() {
926+
return gulp.src('www/build/', {read: false})
927+
.pipe(clean());
928+
});
929+
930+
// Removes the contents in the /e2e/build directory
931+
gulp.task('clean-e2e-build', function() {
932+
return gulp.src('e2e/build/', {read: false})
933+
.pipe(clean());
934+
});
935+
936+
// Removes the contents in the /.sass-cache directory
937+
gulp.task('clean-sass-cache', function() {
938+
return gulp.src('.sass-cache/', {read: false})
939+
.pipe(clean());
940+
});
941+
942+
// Removes the contents in the /node-modules directory
943+
gulp.task('clean-node-modules', function() {
944+
return gulp.src('node_modules/', {read: false})
945+
.pipe(clean());
946+
});

ionic.config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "moodlemobile2",
3+
"app_id": "",
4+
"watchPatterns": [
5+
"www/**/*.html",
6+
"www/build/**/*",
7+
"www/index.html",
8+
"!www/lib/**/*"
9+
]
10+
}

ionic.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "mm2",
2+
"name": "moodlemobile2",
33
"app_id": "",
44
"gulpStartupTasks": [
55
"build",

package.json

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
11
{
22
"name": "mm2",
33
"version": "1.0.0",
4-
"description": "mm2: An Ionic project",
4+
"description": "Moodle Mobile 2: The official mobile app for Moodle.",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/moodlehq/moodlemobile2.git"
8+
},
9+
"license": "Apache-2.0",
10+
"licenses": [
11+
{
12+
"type": "Apache-2.0",
13+
"url": "http://www.apache.org/licenses/LICENSE-2.0"
14+
}
15+
],
516
"dependencies": {
6-
"gulp": "^3.5.6",
7-
"gulp-concat": "^2.2.0",
8-
"gulp-minify-css": "^0.3.0",
9-
"gulp-rename": "^1.2.0",
10-
"gulp-sass": "^1.3.3"
1117
},
1218
"devDependencies": {
13-
"appium": "^1.4.11",
19+
"appium": "^1.6.0",
1420
"bower": "^1.3.3",
21+
"gulp": "^3.9.1",
22+
"gulp-clean-css": "^3.0.3",
23+
"gulp-concat": "^2.6.0",
24+
"gulp-rename": "^1.2.0",
25+
"gulp-sass": "^2.3.2",
26+
"gulp-clean": "^0.3.2",
1527
"gulp-clip-empty-files": "^0.1.1",
1628
"gulp-concat-util": "^0.5.2",
17-
"gulp-file": "^0.2.0",
18-
"gulp-insert": "^0.4.0",
19-
"gulp-ng-annotate": "^1.1.0",
20-
"gulp-remove-empty-lines": "0.0.2",
29+
"gulp-file": "^0.3.0",
30+
"gulp-insert": "^0.5.0",
31+
"gulp-ng-annotate": "^2.0.0",
32+
"gulp-remove-empty-lines": "0.0.8",
2133
"gulp-slash": "^1.1.3",
22-
"gulp-strip-comments": "^1.0.1",
34+
"gulp-strip-comments": "^2.4.3",
2335
"gulp-tap": "^0.1.3",
24-
"gulp-util": "^2.2.14",
36+
"gulp-util": "^3.0.7",
2537
"gulp-zip": "^3.2.0",
2638
"jasmine": "^2.2.1",
2739
"jasmine-core": "^2.2.0",
28-
"karma": "^0.12.31",
29-
"karma-chrome-launcher": "^0.1.7",
30-
"karma-jasmine": "^0.3.5",
40+
"karma": "^1.3.0",
41+
"karma-chrome-launcher": "^2.0.0",
42+
"karma-jasmine": "^1.0.2",
3143
"plist": "^1.1.0",
32-
"protractor": "^2.2.0",
44+
"protractor": "^4.0.9",
3345
"shelljs": "^0.3.0",
3446
"through": "^2.3.6",
3547
"wd": "^0.4.0",
@@ -85,7 +97,30 @@
8597
"nl.kingsquare.cordova.background-audio"
8698
],
8799
"cordovaPlatforms": [
88-
"ios",
89-
"android"
90-
]
100+
{
101+
"platform": "ios",
102+
"version": "4.3.0",
103+
"locator": "[email protected]"
104+
},
105+
{
106+
"platform": "android",
107+
"version": "6.1.2",
108+
"locator": "[email protected]"
109+
}
110+
],
111+
"scripts": {
112+
"setup": "npm install && ionic state restore && bower install && gulp",
113+
"reinstall": "gulp clean-build && gulp clean-libs && gulp clean-node-modules && npm run-script setup",
114+
"start": "ionic serve",
115+
"clean": "gulp clean-build",
116+
"build.e2e": "gulp e2e-build",
117+
"build.dev": "gulp",
118+
"build.android": "ionic build android",
119+
"build.ios": "ionic build ios",
120+
"ios": "ionic run ios",
121+
"android": "ionic run android",
122+
"serve.e2e": "ionic serve -b -a",
123+
"serve.dev": "ionic serve",
124+
"e2e": "protractor e2e/build/protractor.conf.js"
125+
}
91126
}

0 commit comments

Comments
 (0)