Skip to content

Commit 7897e2d

Browse files
authored
Plamen5kov/update gradle to latest stable (#849)
* update runtime project update gradle of projects update gitmodules and gitignore update root build gradle add new project structure named new module so no breaking changes updated gitignore after gitignore update update build.gradle mssing build-artifacts folder stop ignoring build-artifactse add optimization flags (fix warnings later) update readme * add iml file or android studio does not open the project ok * update travis to use ndk 15c * bump android version * add accept licenses in travis * trying to fix travis * trying to fix travis
1 parent 88731f9 commit 7897e2d

File tree

681 files changed

+30593
-31626
lines changed

Some content is hidden

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

681 files changed

+30593
-31626
lines changed

.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
node_modules/
33
dist/
44
.gradle
5-
/test-app/build
6-
/test-app/libs
7-
/test-app/metadata
85
.idea
96

107
local.properties
@@ -21,4 +18,3 @@ bin/
2118
.DS_Store
2219
.settings
2320

24-
*.iml

.gitmodules

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[submodule "test-app/assets/app/shared"]
2-
path = test-app/app/src/main/assets/app/shared
3-
url = [email protected]:NativeScript/common-runtime-tests-app.git
4-
[submodule "test-app/assets/app/tns_modules/shared"]
1+
[submodule "test-app/app/src/main/assets/app/tns_modules/tns-core-modules/shared"]
52
path = test-app/app/src/main/assets/app/tns_modules/tns-core-modules/shared
6-
url = [email protected]:NativeScript/common-runtime-tests-modules.git
3+
url = https://github.com/NativeScript/common-runtime-tests-modules.git
4+
[submodule "test-app/app/src/main/assets/app/shared"]
5+
path = test-app/app/src/main/assets/app/shared
6+
url = https://github.com/NativeScript/common-runtime-tests-app.git

.idea/.name

-1
This file was deleted.

.idea/compiler.xml

-22
This file was deleted.

.idea/copyright/profiles_settings.xml

-3
This file was deleted.

.idea/encodings.xml

-6
This file was deleted.

.idea/misc.xml

-19
This file was deleted.

.idea/runConfigurations.xml

-12
This file was deleted.

.idea/vcs.xml

-6
This file was deleted.

.travis.yml

+18-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
env:
22
global:
33
- NODE_VERSION=6.11.1
4-
- NDK_VERSION=r12b
4+
- NDK_VERSION=r15c
55
- DATE=$(date +%Y-%m-%d)
66
- PACKAGE_VERSION=next-$DATE-$TRAVIS_BUILD_NUMBER
77
- EMULATOR_API_LEVEL=21
@@ -15,24 +15,30 @@ git:
1515
submodules: false
1616
android:
1717
components:
18-
- platform-tools
19-
- tools
20-
- build-tools-25.0.2
21-
- android-23
22-
- android-$EMULATOR_API_LEVEL
23-
- extra-android-support
24-
- extra-android-m2repository
25-
- sys-img-$ANDROID_ABI-android-$EMULATOR_API_LEVEL
18+
- platform-tools
19+
- tools
20+
- build-tools-26.0.1
21+
- android-26
22+
- android-$EMULATOR_API_LEVEL
23+
- extra-android-support
24+
- extra-android-m2repository
25+
- cmake
26+
- sys-img-$ANDROID_ABI-android-$EMULATOR_API_LEVEL
27+
licenses:
28+
- 'android-sdk-preview-license-52d11cd2'
29+
- 'android-sdk-license-.+'
30+
- 'google-gdk-license-.+'
2631
before_cache:
2732
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
2833
cache:
2934
directories:
3035
- "$HOME/.gradle/caches/"
3136
- "$HOME/.gradle/wrapper/"
3237
before_install:
38+
- echo "y" | sdkmanager "cmake;3.6.4111459"
3339
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
3440
- git submodule update --init --recursive
35-
- wget http://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux-x86_64.zip
41+
- wget https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux-x86_64.zip
3642
- chmod +x android-ndk-$NDK_VERSION-linux-x86_64.zip
3743
- "unzip -q android-ndk-$NDK_VERSION-linux-x86_64.zip"
3844
- "rm -rf android-ndk-$NDK_VERSION-linux-x86_64.zip"
@@ -41,10 +47,10 @@ before_install:
4147
install:
4248
- nvm install $NODE_VERSION
4349
script:
44-
- "./gradlew createPackage -i -PpreReleaseVersion=$PACKAGE_VERSION -PgitCommitVersion=$TRAVIS_COMMIT --stacktrace"
50+
- "./gradlew -PpreReleaseVersion=$PACKAGE_VERSION -PgitCommitVersion=$TRAVIS_COMMIT --stacktrace"
4551
- echo no | android create avd --force -n $EMULATOR_NAME-$EMULATOR_API_LEVEL -t android-$EMULATOR_API_LEVEL --abi $ANDROID_ABI -c 12M
4652
- emulator -avd $EMULATOR_NAME-$EMULATOR_API_LEVEL -no-skin -no-audio -no-window &
4753
- android-wait-for-emulator
48-
- "cd test-app && ./gradlew assembleDebug runtests -PembedBindingGenerator=true --stacktrace"
54+
- "cd test-app && ./gradlew runtest --stacktrace"
4955
- adb -e logcat -d 300
5056
- cd ..

README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@ Contains the source code for the NativeScript's Android runtime. The android-run
66
# Main Projects
77
The repo is structured in the following projects (ordered by dependencies):
88

9-
* **android-metadata-generator** - generates metadata necessary for the Android Runtime.
10-
* **android-binding-generator** - enables Java & Android types to be dynamically created at runtime. Needed by the `extend` routine.
11-
* **android-runtime** - contains the core logic behind the NativeScript's Android Runtime. This project contains native C++ code and needs the Android NDK to build properly.
12-
* **android-runtime-testapp** - this is a vanilla Android Application, which contains the tests for the runtime project.
9+
* [**android-metadata-generator**](android-metadata-generator) - generates metadata necessary for the Android Runtime.
10+
* [**android-binding-generator**](test-app/runtime-binding-generator) - enables Java & Android types to be dynamically created at runtime. Needed by the `extend` routine.
11+
* [**android-runtime**](test-app/runtime) - contains the core logic behind the NativeScript's Android Runtime. This project contains native C++ code and needs the Android NDK to build properly.
12+
* [**android-runtime-testapp**](test-app/app) - this is a vanilla Android Application, which contains the tests for the runtime project.
1313

1414
# Helper Projects
1515

16-
* **android-static-binding-generator** - build tool that generates bindings based on the user's javascript code
17-
* **android-binding-generator-tester** - contains the tests for the binding-generator project.
18-
* **build/project-template** - this is an empty placeholder Android Application project, used by the [NativeScript CLI](https://github.com/NativeScript/nativescript-cli) when building an Android project.
16+
* [**android-static-binding-generator**](android-static-binding-generator) - build tool that generates bindings based on the user's javascript code.
17+
* [**project-template**](build-artifacts/project-template-gradle) - this is an empty placeholder Android Application project, used by the [NativeScript CLI](https://github.com/NativeScript/nativescript-cli) when building an Android project.
1918

2019
# Build Prerequisites
2120
Following are the minimal prerequisites to build the runtime package.
2221

2322
* Install the latest [Android Studio ](https://developer.android.com/studio/index.html).
2423
* Install Android API Level 22, 23, 24, 25 from Android Studio -> Tools -> Android -> SDK Manager
25-
* Android NDK 12b - [NDK Archives](https://developer.android.com/ndk/downloads/older_releases.html)
24+
* Android NDK 15c - [NDK Archives](https://developer.android.com/ndk/downloads/older_releases.html) or [NDK Downloads](https://developer.android.com/ndk/downloads/index.html) if you can't find it in the archives.
2625
* Download Android Support Repository through the Android SDK Manager
2726
* Download Build Tools 25.0.2 through the Android SDK Manager.
2827

@@ -33,13 +32,13 @@ Following are the minimal prerequisites to build the runtime package.
3332
Windows:
3433

3534
```Shell
36-
gradlew createPackage
35+
gradlew
3736
```
3837

3938
Mac/Linux:
4039

4140
```Shell
42-
./gradlew createPackage
41+
./gradlew
4342
```
4443

4544
* The build process includes building of the runtime package (both optimized and with unstripped v8 symbol table), as well as all supplementary tools used for the android builds: metadata-generator, binding-generator, metadata-generator, static-binding-generator
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Tue Jan 26 13:45:26 EET 2016
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip

android-metadata-generator/gradlew

+42-30
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22

33
##############################################################################
44
##
55
## Gradle start up script for UN*X
66
##
77
##############################################################################
88

9-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10-
DEFAULT_JVM_OPTS=""
9+
# Attempt to set APP_HOME
10+
# Resolve links: $0 may be a link
11+
PRG="$0"
12+
# Need this for relative symlinks.
13+
while [ -h "$PRG" ] ; do
14+
ls=`ls -ld "$PRG"`
15+
link=`expr "$ls" : '.*-> \(.*\)$'`
16+
if expr "$link" : '/.*' > /dev/null; then
17+
PRG="$link"
18+
else
19+
PRG=`dirname "$PRG"`"/$link"
20+
fi
21+
done
22+
SAVED="`pwd`"
23+
cd "`dirname \"$PRG\"`/" >/dev/null
24+
APP_HOME="`pwd -P`"
25+
cd "$SAVED" >/dev/null
1126

1227
APP_NAME="Gradle"
1328
APP_BASE_NAME=`basename "$0"`
1429

30+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31+
DEFAULT_JVM_OPTS=""
32+
1533
# Use the maximum available, or set MAX_FD != -1 to use that value.
1634
MAX_FD="maximum"
1735

18-
warn ( ) {
36+
warn () {
1937
echo "$*"
2038
}
2139

22-
die ( ) {
40+
die () {
2341
echo
2442
echo "$*"
2543
echo
@@ -30,6 +48,7 @@ die ( ) {
3048
cygwin=false
3149
msys=false
3250
darwin=false
51+
nonstop=false
3352
case "`uname`" in
3453
CYGWIN* )
3554
cygwin=true
@@ -40,26 +59,11 @@ case "`uname`" in
4059
MINGW* )
4160
msys=true
4261
;;
62+
NONSTOP* )
63+
nonstop=true
64+
;;
4365
esac
4466

45-
# Attempt to set APP_HOME
46-
# Resolve links: $0 may be a link
47-
PRG="$0"
48-
# Need this for relative symlinks.
49-
while [ -h "$PRG" ] ; do
50-
ls=`ls -ld "$PRG"`
51-
link=`expr "$ls" : '.*-> \(.*\)$'`
52-
if expr "$link" : '/.*' > /dev/null; then
53-
PRG="$link"
54-
else
55-
PRG=`dirname "$PRG"`"/$link"
56-
fi
57-
done
58-
SAVED="`pwd`"
59-
cd "`dirname \"$PRG\"`/" >/dev/null
60-
APP_HOME="`pwd -P`"
61-
cd "$SAVED" >/dev/null
62-
6367
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6468

6569
# Determine the Java command to use to start the JVM.
@@ -85,7 +89,7 @@ location of your Java installation."
8589
fi
8690

8791
# Increase the maximum file descriptors if we can.
88-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
92+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
8993
MAX_FD_LIMIT=`ulimit -H -n`
9094
if [ $? -eq 0 ] ; then
9195
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -150,11 +154,19 @@ if $cygwin ; then
150154
esac
151155
fi
152156

153-
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154-
function splitJvmOpts() {
155-
JVM_OPTS=("$@")
157+
# Escape application args
158+
save () {
159+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160+
echo " "
156161
}
157-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
162+
APP_ARGS=$(save "$@")
163+
164+
# Collect all arguments for the java command, following the shell quoting and substitution rules
165+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166+
167+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169+
cd "$(dirname "$0")"
170+
fi
159171

160-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
172+
exec "$JAVACMD" "$@"

android-metadata-generator/gradlew.bat

+4-10
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
@rem Set local scope for the variables with windows NT shell
99
if "%OS%"=="Windows_NT" setlocal
1010

11-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12-
set DEFAULT_JVM_OPTS=
13-
1411
set DIRNAME=%~dp0
1512
if "%DIRNAME%" == "" set DIRNAME=.
1613
set APP_BASE_NAME=%~n0
1714
set APP_HOME=%DIRNAME%
1815

16+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17+
set DEFAULT_JVM_OPTS=
18+
1919
@rem Find java.exe
2020
if defined JAVA_HOME goto findJavaFromJavaHome
2121

@@ -46,10 +46,9 @@ echo location of your Java installation.
4646
goto fail
4747

4848
:init
49-
@rem Get command-line arguments, handling Windowz variants
49+
@rem Get command-line arguments, handling Windows variants
5050

5151
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
5352

5453
:win9xME_args
5554
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
6059
if "x%~1" == "x" goto execute
6160

6261
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
6862

6963
:execute
7064
@rem Setup the command line

0 commit comments

Comments
 (0)