Skip to content

Commit

Permalink
Merge branch 'master' into TIMOB-25277
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Nov 30, 2017
2 parents 4f596a3 + 9f66874 commit 72ddf8a
Show file tree
Hide file tree
Showing 353 changed files with 13,918 additions and 6,377 deletions.
3,205 changes: 3,205 additions & 0 deletions AppSpider.scfg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
appcJs: {
src: [ 'Gruntfile.js', 'apidoc/**/*.js', 'build/**/*.js', 'cli/!(locales)/**/*.js', 'android/cli/!(locales)/**/*.js', 'iphone/cli/!(locales)/**/*.js' ]
src: [ 'dangerfile.js', 'Gruntfile.js', 'apidoc/**/*.js', 'build/**/*.js', 'cli/!(locales)/**/*.js', 'android/cli/!(locales)/**/*.js', 'iphone/cli/!(locales)/**/*.js' ]
},
clangFormat: {
src: iosSrc
Expand Down
74 changes: 43 additions & 31 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ def npmVersion = '5.4.1' // We can change this without any changes to Jenkins.

def unitTests(os, nodeVersion, testSuiteBranch) {
return {
// TODO Customize labels by os we're testing
node('android-emulator && git && android-sdk && osx') {
def labels = 'git && osx'
if ('ios'.equals(os)) {
labels = 'git && osx && xcode-9' // test app fails to build with xcode-8.1 as far as I can tell
} else {
labels = 'git && osx && android-emulator && android-sdk' // FIXME get working on windows/linux!
}
node(labels) {
timeout(20) {
// Unarchive the osx build of the SDK (as a zip)
sh 'rm -rf osx.zip' // delete osx.zip file if it already exists
Expand All @@ -43,6 +48,7 @@ def unitTests(os, nodeVersion, testSuiteBranch) {
}
}
// copy over any overridden unit tests into this workspace
sh 'rm -rf tests'
unstash 'override-tests'
sh 'cp -R tests/ titanium-mobile-mocha-suite'
// Now run the unit test suite
Expand Down Expand Up @@ -98,6 +104,7 @@ timestamps {
if (fileExists('titanium_mobile.git')) {
dir('titanium_mobile.git') {
sh 'git remote update -p' // update the clone
sh 'git prune' // prune to avoid "warning: There are too many unreachable loose objects"
}
} else {
sh 'git clone --mirror git@github.com:appcelerator/titanium_mobile.git' // create a mirror
Expand Down Expand Up @@ -193,7 +200,7 @@ timestamps {
// TODO parallelize the iOS/Android/Mobileweb/Windows portions!
dir('build') {
timeout(15) {
sh 'node scons.js build --android-ndk /opt/android-ndk-r11c --android-sdk /opt/android-sdk'
sh "node scons.js build --android-ndk ${env.ANDROID_NDK_R12B} --android-sdk ${env.ANDROID_SDK}"
} // timeout
ansiColor('xterm') {
if (isPR) {
Expand All @@ -212,32 +219,31 @@ timestamps {
stash includes: 'tests/', name: 'override-tests'
} // end 'Build' stage

stage('Security') {
// Clean up and install only production dependencies
sh 'npm prune --production'

// Scan for NSP and RetireJS warnings
def scanFiles = []
sh 'npm install -g nsp'
def nspExitCode = sh(returnStatus: true, script: 'nsp check --output json 2> nsp.json')
if (nspExitCode != 0) {
scanFiles << [path: 'nsp.json']
}
if (isMainlineBranch) {
stage('Security') {
// Clean up and install only production dependencies
sh 'npm prune --production'

sh 'npm install -g retire'
def retireExitCode = sh(returnStatus: true, script: 'retire --outputformat json --outputpath ./retire.json')
// Scan for Dependency Check and RetireJS warnings
def scanFiles = [[path: 'dependency-check-report.xml']]
dependencyCheckAnalyzer datadir: '', hintsFile: '', includeCsvReports: true, includeHtmlReports: true, includeJsonReports: true, isAutoupdateDisabled: false, outdir: '', scanpath: 'package.json', skipOnScmChange: false, skipOnUpstreamChange: false, suppressionFile: '', zipExtensions: ''
dependencyCheckPublisher canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''

if (retireExitCode != 0) {
scanFiles << [path: 'retire.json']
}
sh 'npm install -g retire'
def retireExitCode = sh(returnStatus: true, script: 'retire --outputformat json --outputpath ./retire.json')
if (retireExitCode != 0) {
scanFiles << [path: 'retire.json']
}

if (!scanFiles.isEmpty()) {
step([$class: 'ThreadFixPublisher', appId: '136', scanFiles: scanFiles])
}
// Don't publish to threadfix except for master builds
if ('master'.equals(env.BRANCH_NAME) && !scanFiles.isEmpty()) {
step([$class: 'ThreadFixPublisher', appId: '136', scanFiles: scanFiles])
}

// re-install dev dependencies for testing later...
sh(returnStatus: true, script: 'npm install --only=dev') // ignore PEERINVALID grunt issue for now
} // end 'Security' stage
// re-install dev dependencies for testing later...
sh(returnStatus: true, script: 'npm install --only=dev') // ignore PEERINVALID grunt issue for now
} // end 'Security' stage
}
} // nodeJs
} // end node for checkout/build

Expand Down Expand Up @@ -305,6 +311,7 @@ timestamps {
}

// unarchive zips
sh 'rm -rf dist/'
unarchive mapping: ['dist/': '.']
// Have to use Java-style loop for now: https://issues.jenkins-ci.org/browse/JENKINS-26481
def oses = ['osx', 'linux', 'win32']
Expand Down Expand Up @@ -380,11 +387,13 @@ timestamps {
pluginFailureResultConstraint: 'FAILURE',
userMetadata: []])

// Trigger titanium_mobile_windows if this is the first build on a "mainline" branch
if (isFirstBuildOnBranch) {
// Trigger build of titanium_mobile_windows in our pipeline multibranch group!
build job: "../titanium_mobile_windows/${env.BRANCH_NAME}", wait: false
}
// Trigger titanium_mobile_windows if this is the first build on a "mainline" branch
if (isFirstBuildOnBranch) {
// Trigger build of titanium_mobile_windows in our pipeline multibranch group!
build job: "../titanium_mobile_windows/${env.BRANCH_NAME}", wait: false
}
// Now wipe the workspace. otherwise the unstashed artifacts will stick around on the node (master)
deleteDir()
} // node
} // isMainlineBranch
} // stage
Expand Down Expand Up @@ -413,10 +422,13 @@ timestamps {
// FIXME We need to hack the env vars for Danger.JS because it assumes Github Pull Request Builder plugin only
// We use Github branch source plugin implicitly through pipeline job
// See https://github.com/danger/danger-js/issues/379
withEnv(['ghprbGhRepository=appcelerator/titanium_mobile',"ghprbPullId=${env.CHANGE_ID}"]) {
withEnv(['ghprbGhRepository=appcelerator/titanium_mobile',"ghprbPullId=${env.CHANGE_ID}", "ZIPFILE=${basename}-osx.zip", "BUILD_STATUS=${currentBuild.currentResult}"]) {
// FIXME Can't pass along env variables properly, so we cheat and write them as a JSON file we can require
sh 'node -p \'JSON.stringify(process.env)\' > env.json'
sh 'npx danger'
} // withEnv
} // nodejs
deleteDir()
} // node
} // Danger stage
} // isPR
Expand Down
2 changes: 1 addition & 1 deletion android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 15 additions & 8 deletions android/build/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ Common ant tasks and macros for building Android-based Titanium modules and proj
<javac destdir="@{build.dir}"
includes="@{includes}"
excludes="@{excludes}"
target="1.6"
source="1.6"
target="1.7"
source="1.7"
fork="true"
debug="@{debug}"
includeantruntime="false">
Expand Down Expand Up @@ -382,7 +382,7 @@ Common ant tasks and macros for building Android-based Titanium modules and proj
<generate.bindings dest="${kroll.v8.project.dir}/generated"/>
</target>

<target name="build.kroll.v8.so" depends="generate.kroll.v8.bindings">
<target name="build.kroll.v8.so" depends="generate.kroll.v8.bindings,copy.kroll.v8.jars">
<condition property="ndk.build.args" value="" else="-j8">
<os family="windows"/>
</condition>
Expand All @@ -404,7 +404,7 @@ Common ant tasks and macros for building Android-based Titanium modules and proj
<mkdir dir="${kroll.common.classes.dir}"/>
<javac srcdir="${kroll.common.project.dir}/src/java"
destdir="${kroll.common.classes.dir}" debug="true"
source="1.6" target="1.6"
source="1.7" target="1.7"
includeantruntime="false"
fork="true">
<classpath refid="android"/>
Expand All @@ -414,14 +414,21 @@ Common ant tasks and macros for building Android-based Titanium modules and proj
<jar destfile="${kroll.common.dest}" basedir="${kroll.common.classes.dir}"/>
</target>

<target name="build.kroll.v8.jar" depends="build.kroll.common.jar">
<target name="copy.kroll.v8.jars">
<copy todir="${dist.dir}">
<fileset dir="${kroll.v8.project.dir}/lib" includes="**/*.jar"/>
</copy>
</target>

<target name="build.kroll.v8.jar" depends="build.kroll.common.jar,copy.kroll.v8.jars">
<property name="kroll.v8.classes.dir" location="${dist.classes.dir}/kroll-v8"/>
<mkdir dir="${kroll.v8.classes.dir}"/>
<javac srcdir="${kroll.v8.project.dir}/src/java" destdir="${kroll.v8.classes.dir}" debug="true"
target="1.6" source="1.6" includeantruntime="false" fork="true">
target="1.7" source="1.7" includeantruntime="false" fork="true">
<classpath refid="android"/>
<classpath>
<fileset file="${dist.dir}/kroll-common.jar"/>
<fileset file="${dist.dir}/java_websocket.jar"/>
</classpath>
</javac>

Expand Down Expand Up @@ -653,8 +660,8 @@ Common ant tasks and macros for building Android-based Titanium modules and proj
classpathref="ti.build.lib.path"
includeantruntime="false"
debug="true"
target="1.6"
source="1.6"
target="1.7"
source="1.7"
fork="true"/>
<jar basedir="${dist.classes.dir}/ant-tasks" destfile="${dist.dir}/ant-tasks.jar"/>
</sequential>
Expand Down
2 changes: 1 addition & 1 deletion android/build/libv8.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
libv8.version=5.7.492.71
libv8.version=6.2.414.36
libv8.mode=release

0 comments on commit 72ddf8a

Please sign in to comment.