mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
# Conflicts: # lib/models/workouts/log.dart # test/gallery/gallery_screen_test.mocks.dart # test/measurements/measurement_categories_screen_test.mocks.dart # test/measurements/measurement_provider_test.mocks.dart # test/nutrition/nutritional_plan_form_test.mocks.dart # test/other/base_provider_test.mocks.dart # test/workout/workout_form_test.mocks.dart # test/workout/workout_set_form_test.mocks.dart
102 lines
3.3 KiB
Groovy
102 lines
3.3 KiB
Groovy
def localProperties = new Properties()
|
|
def localPropertiesFile = rootProject.file('local.properties')
|
|
if (localPropertiesFile.exists()) {
|
|
localPropertiesFile.withReader('UTF-8') { reader ->
|
|
localProperties.load(reader)
|
|
}
|
|
}
|
|
|
|
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
|
if (flutterRoot == null) {
|
|
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
|
}
|
|
|
|
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
|
if (flutterVersionCode == null) {
|
|
flutterVersionCode = '1'
|
|
}
|
|
|
|
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
|
if (flutterVersionName == null) {
|
|
flutterVersionName = '1.0'
|
|
}
|
|
|
|
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
|
|
|
// Keys for the android play store
|
|
def keystoreProperties = new Properties()
|
|
def keystorePropertiesFile = rootProject.file('../fastlane/metadata/envfiles/key.properties')
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
// Key for wger.de REST API
|
|
def wgerProperties = new Properties()
|
|
def localMapsPropertiesFile = rootProject.file('../fastlane/metadata/envfiles/wger.properties')
|
|
if (localMapsPropertiesFile.exists()) {
|
|
project.logger.info('Load maps properties from local file')
|
|
localMapsPropertiesFile.withReader('UTF-8') { reader ->
|
|
wgerProperties.load(reader)
|
|
}
|
|
} else {
|
|
project.logger.info('Load maps properties from environment')
|
|
try {
|
|
wgerProperties['WGER_API_KEY'] = System.getenv('WGER_API_KEY')
|
|
} catch(NullPointerException e) {
|
|
project.logger.warn('Failed to load WGER_API_KEY from environment.', e)
|
|
}
|
|
}
|
|
def wgerApiKey = wgerProperties.getProperty('WGER_API_KEY')
|
|
if(wgerApiKey == null){
|
|
wgerApiKey = ""
|
|
project.logger.error('Wger Api Key not configured. Set it in `/fastlane/metadata/android/envfiles/wger.properties` or in the environment variable `WGER_API_KEY`')
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion 32
|
|
|
|
sourceSets {
|
|
main.java.srcDirs += 'src/main/kotlin'
|
|
}
|
|
|
|
lintOptions {
|
|
disable 'InvalidPackage'
|
|
}
|
|
|
|
defaultConfig {
|
|
// Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
applicationId "de.wger.flutter"
|
|
minSdkVersion 21
|
|
targetSdkVersion 32
|
|
versionCode flutterVersionCode.toInteger()
|
|
versionName flutterVersionName
|
|
manifestPlaceholders += [WGER_API_KEY: wgerApiKey]
|
|
}
|
|
|
|
signingConfigs {
|
|
release {
|
|
keyAlias keystoreProperties['keyAlias']
|
|
keyPassword keystoreProperties['keyPassword']
|
|
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
|
storePassword keystoreProperties['storePassword']
|
|
}
|
|
}
|
|
buildTypes {
|
|
release {
|
|
// TODO: Add your own signing config for the release build.
|
|
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
signingConfig signingConfigs.release
|
|
}
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source '../..'
|
|
}
|
|
|
|
dependencies {
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
}
|