apply plugin: 'com.android.application' // Release identity is explicit; ordinary developer builds retain the -dev label. def releaseVersion = providers.gradleProperty('aiturkReleaseVersion').orNull def releaseCode = providers.gradleProperty('aiturkReleaseVersionCode').orNull if ((releaseVersion == null) != (releaseCode == null)) { throw new GradleException('Both aiturkReleaseVersion and aiturkReleaseVersionCode are required') } def selectedVersionCode = 5 if (releaseVersion != null) { if (!(releaseVersion ==~ /\d+\.\d+\.\d+(?:-beta\.\d+)?/)) { throw new GradleException('Release version must be X.Y.Z or X.Y.Z-beta.N; -dev is not a release') } if (!(releaseCode ==~ /[1-9]\d{0,9}/) || releaseCode.toLong() <= 5 || releaseCode.toLong() > 2100000000L) { throw new GradleException('Release version code must be greater than 5 and at most 2100000000') } selectedVersionCode = releaseCode.toInteger() } android { namespace = "online.turkservis.aiturk.mobile" compileSdk = rootProject.ext.compileSdkVersion defaultConfig { applicationId "online.turkservis.aiturk.mobile" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode selectedVersionCode versionName releaseVersion ?: "0.1.4-dev" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } repositories { flatDir{ dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" implementation project(':capacitor-android') testImplementation "junit:junit:$junitVersion" androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" implementation project(':capacitor-cordova-android-plugins') } apply from: 'capacitor.build.gradle' try { def servicesJSON = file('google-services.json') if (servicesJSON.text) { apply plugin: 'com.google.gms.google-services' } } catch(Exception e) { logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") }