feat!: unify & fix gradle library/tooling overrides (#1212)

* enhancement: Control SDK versions and other default projects in one place
* fix: target/compile sdk usage
* refactor: cleanup gradle process
* chore: cleanup and remove unused changes
* chore: remove more unneeded FILE_PATH
* chore: fix lint error
* revert change intended to be part of a different PR
* chore: apply changes to revert to fit new changes
* fix: Ensure proper types
* breaking: Removed TempateFile class
  * Replaced the one and only usage of it with the properties-parser editor.
  * Breaking change because we are converting a method into an asynchronous method.
* refactor: Use the sync version of properties editor
* Gh 1178 fix sdk use gradlearg fix (#2)
* fix: readd gradleArg support
* fix: variable name
* refactor: remove unused mock variables
* Update bin/templates/cordova/lib/builders/ProjectBuilder.js
* Update bin/lib/create.js
* fix: const naming (review suggestion)
* fix: use defaults for framework building
* chore: apply review suggestion
* chore: rename config.json & defaults.json (review suggestions)
* refactor: updateUserProjectGradleConfig method
* refactor: minor changes in updateUserProjectGradleConfig
* refactor: major changes in updateUserProjectGradleConfig
* fix: wrong handling of missing preferences
* fix: usage of undefined this
* fix(create.spec): mocking of getPreference
* test(check_reqs): reduce diff size
* refactor: add wrapper to load gradle config defaults
* fix(check_reqs): get_target
  * Reads default SDK from default gradle config now
* fix(check_reqs.spec): return correct types from mocks
* revert to using get_target in create
* fix: e2e test

Co-authored-by: Erisu <ellis.bryan@gmail.com>
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
This commit is contained in:
Norman Breau
2021-07-06 03:38:28 -03:00
committed by GitHub
parent 47aa116b1d
commit 510596f515
22 changed files with 268 additions and 254 deletions

View File

@@ -18,14 +18,16 @@
apply plugin: 'com.android.application'
apply from: '../../../framework/cordova.gradle'
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdkVersion cordovaConfig.SDK_VERSION
buildToolsVersion cordovaConfig.BUILD_TOOLS_VERSION
defaultConfig {
applicationId "org.apache.cordova.unittests"
minSdkVersion 22
targetSdkVersion 30
minSdkVersion cordovaConfig.MIN_SDK_VERSION
targetSdkVersion cordovaConfig.SDK_VERSION
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -42,7 +44,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(path: ':CordovaLib')
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation "androidx.appcompat:appcompat:${cordovaConfig.ANDROIDX_APP_COMPAT_VERSION}"
testImplementation 'org.json:json:20140107'
testImplementation 'junit:junit:4.12'

View File

@@ -19,6 +19,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
apply from: '../../framework/cordova.gradle'
repositories {
google()
mavenCentral()
@@ -28,7 +30,7 @@ buildscript {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "com.android.tools.build:gradle:${cordovaConfig.AGP_VERSION}"
}
}

View File

@@ -17,5 +17,6 @@
*/
wrapper {
gradleVersion = '6.8.3'
apply from: '../../framework/cordova.gradle'
gradleVersion = cordovaConfig.GRADLE_VERSION
}