Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bpresles
Cesium
Commits
d0fc823b
Commit
d0fc823b
authored
5 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Fix gulp file
parent
a64e6d1c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
gulpfile.js
+3
-4
3 additions, 4 deletions
gulpfile.js
release.sh
+0
-205
0 additions, 205 deletions
release.sh
scripts/build-android.sh
+7
-2
7 additions, 2 deletions
scripts/build-android.sh
scripts/env-global.sh
+16
-0
16 additions, 0 deletions
scripts/env-global.sh
www/js/config.js
+1
-1
1 addition, 1 deletion
www/js/config.js
with
27 additions
and
212 deletions
gulpfile.js
+
3
−
4
View file @
d0fc823b
...
@@ -21,7 +21,6 @@ const gulp = require('gulp'),
...
@@ -21,7 +21,6 @@ const gulp = require('gulp'),
useref
=
require
(
'
gulp-useref
'
),
useref
=
require
(
'
gulp-useref
'
),
filter
=
require
(
'
gulp-filter
'
),
filter
=
require
(
'
gulp-filter
'
),
uglify
=
require
(
'
gulp-uglify
'
),
uglify
=
require
(
'
gulp-uglify
'
),
concat
=
require
(
'
gulp-concat
'
),
csso
=
require
(
'
gulp-csso
'
),
csso
=
require
(
'
gulp-csso
'
),
replace
=
require
(
'
gulp-replace
'
),
replace
=
require
(
'
gulp-replace
'
),
rev
=
require
(
'
gulp-rev
'
),
rev
=
require
(
'
gulp-rev
'
),
...
@@ -637,9 +636,9 @@ gulp.task('build', [
...
@@ -637,9 +636,9 @@ gulp.task('build', [
'
plugin
'
'
plugin
'
]);
]);
gulp
.
task
(
'
ionic:serve:before
'
,
[
'
build
'
,
'
watch
'
]);
gulp
.
task
(
'
ionic:serve:before
'
,
[
'
build
'
,
'
watch
'
]
,
done
=>
done
()
);
gulp
.
task
(
'
sass
'
,
[
'
config
'
,
'
build
'
]
);
gulp
.
task
(
'
sass
'
,
[
'
license
'
,
'
appSass
'
,
'
pluginSass
'
],
done
=>
done
()
);
gulp
.
task
(
'
default
'
,
[
'
config
'
,
'
build
'
]);
gulp
.
task
(
'
default
'
,
[
'
config
'
,
'
build
'
]
,
done
=>
done
()
);
gulp
.
task
(
'
webClean
'
,
[],
webClean
);
gulp
.
task
(
'
webClean
'
,
[],
webClean
);
gulp
.
task
(
'
webCopyFiles
'
,
[
'
config
'
,
'
sass
'
,
'
webClean
'
],
webCopyFiles
);
gulp
.
task
(
'
webCopyFiles
'
,
[
'
config
'
,
'
sass
'
,
'
webClean
'
],
webCopyFiles
);
...
...
This diff is collapsed.
Click to expand it.
release.sh
deleted
100755 → 0
+
0
−
205
View file @
a64e6d1c
#!/bin/bash
DIRNAME
=
$(
dirname
"
$0
"
)
cd
$DIRNAME
### 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
### Get current version (package.json)
current
=
`
grep
-oP
"version
\"
:
\"\d
+.
\d
+.
\d
+((a|b)[0-9]+)?"
package.json |
grep
-m
1
-oP
"
\d
+.
\d
+.
\d
+((a|b)[0-9]+)?"
`
if
[[
"_
$current
"
==
"_"
]]
;
then
echo
"Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
exit
1
;
fi
echo
"Current version:
$current
"
### Get current version for Android
currentAndroid
=
`
grep
-oP
"android-versionCode=
\"
[0-9]+
\"
"
config.xml |
grep
-oP
"
\d
+"
`
if
[[
"_
$currentAndroid
"
==
"_"
]]
;
then
echo
"Unable to read the current Android version in 'config.xml'. Please check version format is an integer."
exit
1
;
fi
echo
"Current Android version:
$currentAndroid
"
# Check version format
if
[[
!
$2
=
~ ^[0-9]+.[0-9]+.[0-9]+
((
a|b
)[
0-9]+
)
?
$
||
!
$3
=
~ ^[0-9]+
$
]]
;
then
echo
"Wrong version format"
echo
"Usage:"
echo
" > ./release.sh [pre|rel] <version> <android-version> <release_description>"
echo
"with:"
echo
" - pre: use for pre-release"
echo
" - rel: for full release"
echo
" - version: x.y.z"
echo
" - android-version: nnn"
echo
" - release_description: a comment on release"
exit
1
fi
echo
"new build version:
$2
"
echo
"new build android version:
$3
"
case
"
$1
"
in
rel|pre
)
# Change the version in files: 'package.json' and 'config.xml'
sed
-i
"s/version
\"
:
\"
$current
\"
/version
\"
:
\"
$2
\"
/g"
package.json
currentConfigXmlVersion
=
`
grep
-oP
"version=
\"\d
+.
\d
+.
\d
+((a|b)[0-9]+)?
\"
"
config.xml |
grep
-oP
"
\d
+.
\d
+.
\d
+((a|b)[0-9]+)?"
`
sed
-i
"s/ version=
\"
$currentConfigXmlVersion
\"
/ version=
\"
$2
\"
/g"
config.xml
sed
-i
"s/ android-versionCode=
\"
$currentAndroid
\"
/ android-versionCode=
\"
$3
\"
/g"
config.xml
# Change version in file: 'www/manifest.json'
currentManifestJsonVersion
=
`
grep
-oP
"version
\"
:
\"\d
+.
\d
+.
\d
+((a|b)[0-9]+)?
\"
"
www/manifest.json |
grep
-oP
"
\d
+.
\d
+.
\d
+((a|b)[0-9]+)?"
`
sed
-i
"s/version
\"
:
\"
$currentManifestJsonVersion
\"
/version
\"
:
\"
$2
\"
/g"
www/manifest.json
# Bump the install.sh
sed
-i
"s/echo
\"
v.*
\"
#lastest/echo
\"
v
$2
\"
#lastest/g"
install.sh
;;
*
)
echo
"No task given"
exit
1
;;
esac
# Load env.sh if exists
if
[[
-f
"
${
DIRNAME
}
/.local/env.sh"
]]
;
then
echo
"Loading .local/env.sh ..."
source
"
${
DIRNAME
}
/.local/env.sh"
$*
fi
# Check the Java version
JAVA_VERSION
=
`
java
-version
2>&1 | egrep
"(java|openjdk) version"
|
awk
'{print $3}'
|
tr
-d
\"
`
if
[[
$?
-ne
0
]]
;
then
echo
"No Java JRE 1.8 found in machine. This is required for Android artifacts."
exit
1
fi
JAVA_MAJOR_VERSION
=
`
echo
${
JAVA_VERSION
}
|
awk
'{split($0, array, ".")} END{print array[1]}'
`
JAVA_MINOR_VERSION
=
`
echo
${
JAVA_VERSION
}
|
awk
'{split($0, array, ".")} END{print array[2]}'
`
if
[[
${
JAVA_MAJOR_VERSION
}
-ne
1
]]
||
[[
${
JAVA_MINOR_VERSION
}
-ne
8
]]
;
then
echo
"Require a Java JRE in version 1.8, but found
${
JAVA_VERSION
}
. You can override your default JAVA_HOME in '.local/env.sh'."
exit
1
fi
echo
"Java:
$JAVA_VERSION
"
# force nodejs version to 6
if
[[
-d
"
$NVM_DIR
"
]]
;
then
.
$NVM_DIR
/nvm.sh
nvm use 6
if
[[
$?
-ne
0
]]
;
then
exit
1
fi
else
echo
"nvm (Node version manager) not found (directory
$NVM_DIR
not found). Please install, and retry"
exit
1
fi
# Update config file
gulp config
--env
default_fr
echo
"----------------------------------"
echo
"- Compiling sources..."
echo
"----------------------------------"
gulp
echo
"----------------------------------"
echo
"- Building Android artifact..."
echo
"----------------------------------"
rm
-rf
platforms/android/build/outputs/release/
*
ionic build android
--release
if
[[
$?
-ne
0
]]
;
then
exit
1
fi
echo
"----------------------------------"
echo
"- Building web artifact..."
echo
"----------------------------------"
# Update config file
gulp config
--env
default
gulp build:web
--release
if
[[
$?
-ne
0
]]
;
then
exit
1
fi
echo
"----------------------------------"
echo
"- Executing git push, with tag: v
$2
"
echo
"----------------------------------"
# Commit
cd
${
DIRNAME
}
git reset HEAD
git add package.json config.xml install.sh www/js/config.js www/manifest.json
if
[[
$?
-ne
0
]]
;
then
exit
1
fi
git commit
-m
"v
$2
"
&&
git tag
"v
$2
"
&&
git push
if
[[
$?
-ne
0
]]
;
then
exit
1
fi
# Commit android project
cd
${
DIRNAME
}
/platforms/android
git reset HEAD
git add
-A
git commit
-m
"v
$2
"
&&
git tag
"v
$2
"
&&
git push
if
[[
$?
-ne
0
]]
;
then
exit
1
fi
# Pause (wait propagation to from git.duniter.org to github)
echo
" Waiting 40s, for propagation to github..."
sleep
40s
description
=
"
$4
"
if
[[
"_
$description
"
==
"_"
]]
;
then
description
=
"Release v
$2
"
fi
echo
"**********************************"
echo
"* Uploading artifacts to Github..."
echo
"**********************************"
./github.sh
$1
''
"
$description
"
''
if
[[
$?
-ne
0
]]
;
then
exit
1
fi
echo
"----------------------------------"
echo
"- Building desktop artifacts..."
echo
"----------------------------------"
git submodule init
&&
git submodule
sync
&&
git submodule update
--remote
--merge
if
[[
$?
-ne
0
]]
;
then
echo
"Unable to sync git submodule. Could not build desktop version"
exit
1
fi
if
[[
-d
"
${
DIRNAME
}
/dist/desktop"
]]
;
then
cd
"
${
DIRNAME
}
/dist/desktop"
# Fetch last updates
git fetch origin
&&
git merge origin/master
||
exit
1
# Build desktop assets
./release.sh
$2
if
[[
$?
-ne
0
]]
;
then
exit
1
fi
else
echo
"ERROR: dist/desktop not found -> Make sure git submodule has been init!"
exit
1
fi
;
# back to nodejs version 6
cd
${
DIRNAME
}
nvm use 6
echo
"**********************************"
echo
"* Build release succeed !"
echo
"**********************************"
This diff is collapsed.
Click to expand it.
scripts/build-android.sh
+
7
−
2
View file @
d0fc823b
#!/bin/bash
#!/bin/bash
# Get to the root project
# Get to the root project
if
[[
"_"
==
"_
${
PROJECT_DIR
}
"
]]
;
then
if
[[
"_"
==
"_
${
PROJECT_DIR
}
"
]]
;
then
SCRIPT_DIR
=
$(
dirname
$0
)
SCRIPT_DIR
=
$(
dirname
$0
)
...
@@ -15,6 +16,10 @@ fi
...
@@ -15,6 +16,10 @@ fi
cd
${
PROJECT_DIR
}
cd
${
PROJECT_DIR
}
# Run the build
# Run the build
echo
"Running cordova build..."
echo
"Cleaning previous android APK files..."
ionic cordova build android
--warning-mode
=
none
--color
rm
-rf
${
ANDROID_OUTPUT_APK_DEBUG
}
/
*
.apk
rm
-rf
${
ANDROID_OUTPUT_APK_RELEASE
}
/
*
.apk
echo
"Running cordova build android..."
ionic cordova build android
--warning-mode
=
none
--color
$*
#ionic cordova build android --warning-mode=none --color --verbose
#ionic cordova build android --warning-mode=none --color --verbose
This diff is collapsed.
Click to expand it.
scripts/env-global.sh
+
16
−
0
View file @
d0fc823b
...
@@ -21,6 +21,9 @@ ANDROID_SDK_VERSION=r29.0.0
...
@@ -21,6 +21,9 @@ ANDROID_SDK_VERSION=r29.0.0
ANDROID_SDK_TOOLS_VERSION
=
4333796
ANDROID_SDK_TOOLS_VERSION
=
4333796
ANDROID_SDK_ROOT
=
/usr/lib/android-sdk
ANDROID_SDK_ROOT
=
/usr/lib/android-sdk
ANDROID_SDK_TOOLS_ROOT
=
${
ANDROID_SDK_ROOT
}
/build-tools
ANDROID_SDK_TOOLS_ROOT
=
${
ANDROID_SDK_ROOT
}
/build-tools
ANDROID_OUTPUT_APK
=
platforms/android/build/outputs/apk
ANDROID_OUTPUT_APK_DEBUG
=
${
ANDROID_OUTPUT_APK
}
/debug
ANDROID_OUTPUT_APK_RELEASE
=
${
ANDROID_OUTPUT_APK
}
/release
#JAVA_HOME=
#JAVA_HOME=
...
@@ -45,6 +48,19 @@ if [[ "_" == "_${JAVA_HOME}" ]]; then
...
@@ -45,6 +48,19 @@ if [[ "_" == "_${JAVA_HOME}" ]]; then
echo
"No Java installed. Please install java, or set env variable JAVA_HOME "
echo
"No Java installed. Please install java, or set env variable JAVA_HOME "
exit
1
exit
1
fi
fi
# Check the Java version
JAVA_VERSION
=
`
java
-version
2>&1 | egrep
"(java|openjdk) version"
|
awk
'{print $3}'
|
tr
-d
\"
`
if
[[
$?
-ne
0
]]
;
then
echo
"No Java JRE 1.8 found in machine. This is required for Android artifacts."
exit
1
fi
JAVA_MAJOR_VERSION
=
`
echo
${
JAVA_VERSION
}
|
awk
'{split($0, array, ".")} END{print array[1]}'
`
JAVA_MINOR_VERSION
=
`
echo
${
JAVA_VERSION
}
|
awk
'{split($0, array, ".")} END{print array[2]}'
`
if
[[
${
JAVA_MAJOR_VERSION
}
-ne
1
]]
||
[[
${
JAVA_MINOR_VERSION
}
-ne
8
]]
;
then
echo
"Require a Java JRE in version 1.8, but found
${
JAVA_VERSION
}
. You can override your default JAVA_HOME in '.local/env.sh'."
exit
1
fi
fi
fi
# Checking Android SDK
# Checking Android SDK
...
...
This diff is collapsed.
Click to expand it.
www/js/config.js
+
1
−
1
View file @
d0fc823b
...
@@ -94,7 +94,7 @@ angular.module("cesium.config", [])
...
@@ -94,7 +94,7 @@ angular.module("cesium.config", [])
}
}
},
},
"
version
"
:
"
1.4.15
"
,
"
version
"
:
"
1.4.15
"
,
"
build
"
:
"
2019-12-27T1
8:57:30.124
Z
"
,
"
build
"
:
"
2019-12-27T1
9:07:17.137
Z
"
,
"
newIssueUrl
"
:
"
https://git.duniter.org/clients/cesium-grp/cesium/issues/new
"
"
newIssueUrl
"
:
"
https://git.duniter.org/clients/cesium-grp/cesium/issues/new
"
})
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment