Skip to content

Commit 049737f

Browse files
committed
Merge branch 'master' into release
2 parents 253c76f + 5209f71 commit 049737f

File tree

120 files changed

+19634
-19964
lines changed

Some content is hidden

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

120 files changed

+19634
-19964
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@ obj/
1515
bin/
1616
.svn/
1717

18-
**/.vscode/
18+
**/.vscode/
19+
20+
.project
21+
.DS_Store
22+
.settings
23+
24+
build-artifacts/

.idea/gradle.xml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/workspace.xml

Lines changed: 0 additions & 523 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ env:
33
- NDK_VERSION=r12b
44
- DATE=$(date +%Y-%m-%d)
55
- PACKAGE_VERSION=next-$DATE-$TRAVIS_BUILD_NUMBER
6-
- PACKAGE_NAME=tns-android
7-
- ANDROID_HOME=/usr/local/android-sdk
86
sudo: true
97
language: android
108
jdk:
@@ -47,26 +45,3 @@ script:
4745
- "cd test-app && ./gradlew assembleDebug runtests -PembedBindingGenerator=true --stacktrace"
4846
- adb -e logcat -d 300
4947
- cd ..
50-
before_deploy:
51-
- FULL_PACKAGE_VERSION=`sed -n 's/\s*"version":\s*"\([a-zA-Z0-9\.]*\)"\s*,*/\1/p' dist/package.json`
52-
- ls -la dist
53-
- mv dist/tns-android*.tgz ../.deploymentpackage
54-
- mv .travis ../
55-
- cd ..
56-
- rm -rf android-runtime
57-
- tar -zxvf .deploymentpackage
58-
- mv package android-runtime
59-
- cd android-runtime
60-
- rm ../.deploymentpackage
61-
- nvm install 4.2.6
62-
- nvm use 4.2.6
63-
- mv ../.travis ./
64-
- node ./.travis/add-publishConfig.js next
65-
deploy:
66-
provider: npm
67-
68-
on:
69-
branch: master
70-
skip_cleanup: true
71-
api_key:
72-
secure: aFJZR8VIbFAlXfFx5G2AveSgpGjr40prghvw8m06X0yvmUQlucwHVyq+Ov0ZD94br8d7OUOPbUzh+p9N/+oXLAXOj3DbQmJaCc+fk/e+avHu1BRy3fg295P9BQau1Abu+2ZO7tUbg5zAqJqhbEgjXsr9B5gxl+vwh4lbDhCPCwo=

.travis/add-publishConfig.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
3.2.0
2+
==
3+
4+
## Bug Fixes
5+
6+
- [Static binding generator fails when using Webpack + Workers (#778)](https://github.com/NativeScript/android-runtime/issues/778)
7+
18
3.1.1
29
==
310

android-metadata-generator/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
/src/jars/
22
/src/com/
3+
/build
4+
*.iml
5+
.gradle
6+
/local.properties
7+
/.idea
8+
!/.idea/misc.xml
9+
/a
10+
!.gitignore

android-static-binding-generator/project/build.gradle

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,18 @@ def cachedJarsFilePath = "$projectDir/cached.txt"
1414
def jsParserP = "$projectDir/parser/js_parser.js"
1515
def jsFilesParametersP = "$projectDir/jsFilesParameters.txt"
1616

17-
18-
19-
//def absoluteOutDir = new File("./outDir")//project.outDir
17+
def webpackWorkersExcludePath = "$projectDir/../../src/main/assets/app/__worker-chunks.json"
18+
def webpackWorkersExcludesList = [];
19+
20+
def workersExcludeFile = file(webpackWorkersExcludePath);
21+
if (workersExcludeFile.exists()) {
22+
// in case the file exists but is malformed
23+
try {
24+
webpackWorkersExcludesList = new JsonSlurper().parseText(workersExcludeFile.text)
25+
} catch (all) {
26+
println "Malformed workers exclude file at ${webpackWorkersExcludePath}"
27+
}
28+
}
2029

2130
def absoluteOutDir;
2231
if (project.hasProperty("outDir")) {
@@ -67,6 +76,8 @@ task generateInterfaceNamesList() {
6776
str.add("interfacenamegenerator.jar")
6877
str.addAll(jarsArr)
6978

79+
logger.info("Task: generateInterfaceNamesList: Call interfacenamegenerator.jar with arguments: " + str.toString().replaceAll(',', ''))
80+
7081
args str.toArray()
7182
}
7283
java.nio.file.Files.write(java.nio.file.Paths.get(cachedJarsFilePath), [current.toString()], utf8)
@@ -75,6 +86,14 @@ task generateInterfaceNamesList() {
7586
}
7687
}
7788

89+
def isJsFile = { fileName -> return fileName.substring(fileName.length() - 3, fileName.length()).equals(".js") }
90+
91+
def isWorkerScript = { fileName ->
92+
// Read __worker-chunks.json file containing a list of webpacked workers
93+
// ignore worker scripts, so as to not attempt to generate bindings for them
94+
return webpackWorkersExcludesList.any{element -> file(element).getAbsolutePath() == fileName}
95+
}
96+
7897
def traverseDirectory
7998

8099
traverseDirectory = { dir, traverseExplicitly ->
@@ -99,7 +118,7 @@ traverseDirectory = { dir, traverseExplicitly ->
99118
return;
100119
} else {
101120
if (pjson.nativescript['recursive-static-bindings']) {
102-
// println "Folder will be traversed completely: " + dir
121+
logger.info("Task: traverseDirectory: Folder will be traversed completely: " + dir)
103122
traverseExplicitly = true;
104123
}
105124
}
@@ -111,10 +130,9 @@ traverseDirectory = { dir, traverseExplicitly ->
111130
}
112131

113132
currentDir.eachFile(FileType.FILES) { File f ->
114-
def file = f.getAbsolutePath();
115-
if (file.substring(file.length() - 3, file.length()).equals(".js")) {
116-
// println "Visiting JavaScript file: " + f.getName()
117-
inputJsFiles.add(f.getAbsolutePath())
133+
def currFile = f.getAbsolutePath();
134+
if (isJsFile(currFile) && !isWorkerScript(currFile)) {
135+
inputJsFiles.add(currFile)
118136
}
119137
}
120138

@@ -140,6 +158,7 @@ task traverseJsFilesArgs << { //(jsCodeDir, bindingsFilePath, interfaceNamesFile
140158
list.add(interfaceNamesFilePath)
141159
list.add(jsFilesParameter)
142160

161+
logger.info("Task: traverseJsFilesArgs: executed with arguments: " + list.toString().replaceAll(',', ''))
143162
def proc = list.execute()
144163
proc.in.eachLine { line -> println line }
145164
proc.out.close()
@@ -235,6 +254,10 @@ class RunAstParserTask extends DefaultTask {
235254
list.add(interfaceNamesFilePath)
236255
list.add(jsFilesParametersPath)
237256

257+
if(project.gradle.startParameter.logLevel.equals(LogLevel.DEBUG)) {
258+
list.add("enableVerboseLogging")
259+
}
260+
logger.info("Task: RunAstParserTask: running node with arguments: " + list.toString().replaceAll(',', ''))
238261
runCommand(list)
239262

240263
// inputs.removed { change ->
@@ -263,6 +286,7 @@ task generateBindings() {
263286
def jarsArr = jarsAsStr.replaceAll(/[\[\]]/, "").split(", ")
264287
str.addAll(jarsArr)
265288

289+
logger.info("Task generateBindings: Call staticbindinggenerator.jar with arguments: " + str.toString().replaceAll(',', ''))
266290
args str.toArray()
267291
}
268292
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/build
2+
*.iml
3+
.gradle
4+
/local.properties
5+
/.idea
6+
!/.idea/misc.xml
7+
/a
8+
!.gitignore
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
group 'interfacenamegenerator'
2+
version '1.0-SNAPSHOT'
3+
4+
apply plugin: 'java'
5+
jar.archiveName = "interfacenamegenerator.jar"
6+
7+
sourceCompatibility = 1.5
8+
9+
repositories {
10+
mavenCentral()
11+
}
12+
13+
jar {
14+
manifest {
15+
attributes 'Main-Class': 'com.ig.GetInterfaceNames'
16+
}
17+
}
18+
19+
dependencies {
20+
testCompile group: 'junit', name: 'junit', version: '4.11'
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Mon Jul 24 14:31:56 EEST 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip

0 commit comments

Comments
 (0)