Skip to content

Commit

Permalink
Merge branch 'master' into TIMOB-27768
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaddique committed Apr 3, 2020
2 parents 5449302 + eb44b79 commit 3810581
Show file tree
Hide file tree
Showing 333 changed files with 4,423 additions and 5,006 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
android/runtime/v8/tools/bootstrap.js
android/dev
android/modules/ui/assets/Resources/ti.internal/webview/*.js
android/titanium/build

iphone/Resources/app.js

Expand Down
19 changes: 5 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ retirejs.output.json
junit.*.xml
junit_report.xml

/android/.project
/android/app/.project
/android/kroll-apt/.project
/android/titanium/.project

/iphone/TitaniumKit/Carthage
/iphone/TitaniumKit/docs
/iphone/TitaniumKit/build
Expand All @@ -33,17 +38,3 @@ junit_report.xml

.nyc_output/
coverage/

/android/titanium/.settings
/android/titanium/.project
/android/titanium/.classpath
/android/kroll-apt/bin
/android/kroll-apt/.settings
/android/kroll-apt/.project
/android/kroll-apt/.classpath
/android/app/.settings
/android/app/.project
/android/app/.classpath
/android/.settings
/android/.project
/android/titanium/.cxx
26 changes: 19 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,17 @@ timestamps {
if (fileExists('npm_test.log')) {
sh 'rm -rf npm_test.log'
}
def npmTestResult = sh(returnStatus: true, script: 'npm test &> npm_test.log')
// forcibly grab and set correct value for android sdk path by grabbing from node we're actually building on (using env.ANDROID_SDK will pick up master node's env value!)
def androidSDK = env.ANDROID_SDK
withEnv(['ANDROID_SDK=']) {
try {
androidSDK = sh(returnStdout: true, script: 'printenv ANDROID_SDK').trim()
} catch (e) {
// squash, env var not set at OS-level
}
}
def npmTestResult = sh(returnStatus: true, script: "ANDROID_SDK_ROOT=${androidSDK} npm test &> npm_test.log")
recordIssues(tools: [checkStyle(pattern: 'android/**/build/reports/checkstyle/checkJavaStyle.xml')])
if (runDanger) { // Stash files for danger.js later
stash includes: 'package.json,package-lock.json,dangerfile.js,.eslintignore,.eslintrc,npm_test.log,android/**/*.java', name: 'danger'
}
Expand All @@ -289,24 +299,26 @@ timestamps {
basename = "dist/mobilesdk-${vtag}"
echo "BASENAME: ${basename}"

// TODO parallelize the iOS/Android portions?
ansiColor('xterm') {
timeout(15) {
def buildCommand = "npm run clean -- --android-ndk ${env.ANDROID_NDK_R16B} --android-sdk ${env.ANDROID_SDK}"
def buildCommand = "npm run clean -- --android-ndk ${env.ANDROID_NDK_R16B}"
if (isMainlineBranch) {
buildCommand += ' --all'
}
sh label: 'clean', script: buildCommand
} // timeout
timeout(15) {
def buildCommand = "npm run build -- --android-ndk ${env.ANDROID_NDK_R16B} --android-sdk ${env.ANDROID_SDK}"
def buildCommand = "npm run build -- --android-ndk ${env.ANDROID_NDK_R16B}"
if (isMainlineBranch) {
buildCommand += ' --all'
}
sh label: 'build', script: buildCommand
recordIssues(tools: [clang(), java()])
try {
sh label: 'build', script: buildCommand
} finally {
recordIssues(tools: [clang(), java()])
}
} // timeout
timeout(15) {
timeout(25) {
def packageCommand = "npm run package -- --version-tag ${vtag}"
if (isMainlineBranch) {
// on mainline builds, build for all 3 host OSes
Expand Down
1 change: 1 addition & 0 deletions android/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ SpaceAfterCStyleCast: true
# Spaces inside {} for array literals, i.e. "new Object[] { args }"
Cpp11BracedListStyle: false
ReflowComments: false
JavaImportGroups: ['java', 'javax', 'org', 'android', 'com']
10 changes: 8 additions & 2 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
.classpath/
.cxx/
.externalNativeBuild/
.gradle/
.idea/
.idea/*
!/.idea/codeStyles/
.project/
.settings/
build/
!/templates/build/
*.iml

/titanium/assets/Resources/ti.internal/build.properties
/kroll-apt/bin/
/local.properties
/titanium/assets/Resources/ti.internal/build.properties
149 changes: 149 additions & 0 deletions android/.idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions android/.idea/codeStyles/codeStyleConfig.xml

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

17 changes: 15 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@

apply plugin: 'com.android.application'

// Set up Android app project.
android {
compileSdkVersion 29
defaultConfig {
applicationId 'com.titanium.test'
minSdkVersion 19
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionName '1.0'
manifestPlaceholders = project.ext.tiManifestPlaceholders
manifestPlaceholders.put('localApplicationId', applicationId) // Legacy placeholder old AARs sometimes use.
}
Expand All @@ -35,6 +36,18 @@ android {
}
}

// Checks our Java code against our style guidelines and for common coding mistakes using "checkstyle.xml".
// Will trigger a build failure if any violations have been detected.
task checkJavaStyle(type: Checkstyle) {
source android.sourceSets.main.java.srcDirs
include '**/*.java'
classpath = files()
}
tasks.withType(JavaCompile) {
dependsOn checkJavaStyle
}

// Define library dependencies used by this app.
dependencies {
implementation(project(':titanium')) {
// Uncomment the below to exclude Google Play Services from app.
Expand Down
1 change: 0 additions & 1 deletion android/app/src/main/assets/Resources/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

'use strict';

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import org.appcelerator.titanium.ITiAppInfo;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiProperties;
import org.appcelerator.kroll.common.Log;

/* GENERATED CODE
* Warning - this class was generated from your application's tiapp.xml
Expand Down
13 changes: 12 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.build:gradle:3.6.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -23,6 +23,17 @@ allprojects {
google()
jcenter()
}

// Load plugin used to enforce our Java coding style guidelines.
project.apply plugin: 'checkstyle'
checkstyle {
toolVersion = '8.30'
configFile file("${rootDir}/checkstyle.xml");
ignoreFailures false
showViolations true
}

// Include Titanium's gradle constants in all gradle sub-projects.
project.apply from: "${rootDir}/templates/build/ti.constants.gradle"
}

Expand Down

0 comments on commit 3810581

Please sign in to comment.