Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 15-improve-app-metadata
  • 24-add-fruits
  • master
  • Release_0.0.10_10
  • Release_0.0.11_11
  • Release_0.0.12_12
  • Release_0.0.1_1
  • Release_0.0.2_2
  • Release_0.0.3_3
  • Release_0.0.4_4
  • Release_0.0.5_5
  • Release_0.0.6_6
  • Release_0.0.7_7
  • Release_0.0.8_8
  • Release_0.0.9_9
  • Release_0.1.0_13
  • Release_0.1.1_14
  • Release_0.10.0_31
  • Release_0.2.0_15
  • Release_0.2.1_16
  • Release_0.3.0_17
  • Release_0.3.1_18
  • Release_0.4.0_19
  • Release_0.5.0_20
  • Release_0.5.1_21
  • Release_0.5.2_22
  • Release_0.5.3_23
  • Release_0.5.4_24
  • Release_0.6.0_25
  • Release_0.7.0_26
  • Release_0.8.0_27
  • Release_0.9.0_28
  • Release_0.9.1_29
  • Release_0.9.2_30
34 results

Target

Select target project
  • android/org.benoitharrault.snake
1 result
Select Git revision
  • 15-improve-app-metadata
  • 24-add-fruits
  • master
  • Release_0.0.10_10
  • Release_0.0.11_11
  • Release_0.0.12_12
  • Release_0.0.1_1
  • Release_0.0.2_2
  • Release_0.0.3_3
  • Release_0.0.4_4
  • Release_0.0.5_5
  • Release_0.0.6_6
  • Release_0.0.7_7
  • Release_0.0.8_8
  • Release_0.0.9_9
  • Release_0.1.0_13
  • Release_0.1.1_14
  • Release_0.10.0_31
  • Release_0.2.0_15
  • Release_0.2.1_16
  • Release_0.3.0_17
  • Release_0.3.1_18
  • Release_0.4.0_19
  • Release_0.5.0_20
  • Release_0.5.1_21
  • Release_0.5.2_22
  • Release_0.5.3_23
  • Release_0.5.4_24
  • Release_0.6.0_25
  • Release_0.7.0_26
  • Release_0.8.0_27
  • Release_0.9.0_28
  • Release_0.9.1_29
  • Release_0.9.2_30
34 results
Show changes
Commits on Source (34)
Showing
with 134 additions and 112 deletions
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.json]
indent_size = 2
[*.yaml]
indent_size = 2
[*.md]
trim_trailing_whitespace = false
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
.buildlog/ .buildlog/
.history .history
.svn/ .svn/
migrate_working_dir/
# IntelliJ related # IntelliJ related
*.iml *.iml
...@@ -22,7 +23,6 @@ ...@@ -22,7 +23,6 @@
# Flutter/Dart/Pub related # Flutter/Dart/Pub related
**/doc/api/ **/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/ .dart_tool/
.flutter-plugins .flutter-plugins
.flutter-plugins-dependencies .flutter-plugins-dependencies
......
image: cirrusci/flutter:latest image: ghcr.io/cirruslabs/flutter:latest
stages: stages:
- update
- build-debug - build-debug
- build-release - build-release
- release - release
- deploy - deploy
update:
stage: update
except:
- tags
script:
- flutter packages get
- flutter packages upgrade
interruptible: true
android:build-debug: android:build-debug:
stage: build-debug stage: build-debug
except: except:
- tags - tags
- master
script: script:
# Flutter local configuration # Flutter local configuration
- echo flutter.sdk=$FLUTTER_PATH > android/local.properties - echo flutter.sdk=$FLUTTER_PATH > android/local.properties
...@@ -32,14 +23,27 @@ android:build-debug: ...@@ -32,14 +23,27 @@ android:build-debug:
- echo keyAlias=$ANDROID_DEBUG_KEY_ALIAS >> android/key.properties - echo keyAlias=$ANDROID_DEBUG_KEY_ALIAS >> android/key.properties
- echo keyPassword=$ANDROID_DEBUG_KEY_PASSWORD >> android/key.properties - echo keyPassword=$ANDROID_DEBUG_KEY_PASSWORD >> android/key.properties
# build flutter app # build flutter app
- VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
- echo "${VERSION_NAME}"
- VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
- echo "${VERSION_CODE}"
- flutter packages get - flutter packages get
- flutter clean - flutter clean
- flutter build apk --debug --split-per-abi
- flutter build apk --debug - flutter build apk --debug
# prepare artifact # prepare artifact
- find . -name "*.apk" # where is my apk? - BASE_APK_FOLDER="build/app/outputs/flutter-apk"
- APP_NAME="$(grep 'namespace' android/app/build.gradle | cut -d'"' -f2)"
- >
if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then
for APK in ${BASE_APK_FOLDER}/*.apk; do
mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|" | sed "s|/app-|/${APP_NAME}-|")"
done
fi
- find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk?
artifacts: artifacts:
paths: paths:
- build/app/outputs/apk/debug - build/app/outputs/flutter-apk
expire_in: 1 week expire_in: 1 week
interruptible: true interruptible: true
...@@ -49,8 +53,6 @@ android:build-release: ...@@ -49,8 +53,6 @@ android:build-release:
- master - master
except: except:
- tags - tags
dependencies:
- android:build-debug
script: script:
# Flutter local configuration # Flutter local configuration
- echo flutter.sdk=$FLUTTER_PATH > android/local.properties - echo flutter.sdk=$FLUTTER_PATH > android/local.properties
...@@ -63,9 +65,12 @@ android:build-release: ...@@ -63,9 +65,12 @@ android:build-release:
- echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties - echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties
- echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties - echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties
# build flutter app # build flutter app
- VERSION_FILE="$(find . -name 'gradle.properties' | head -n1)" - BASE_APK_FOLDER="build/app/outputs/flutter-apk"
- VERSION_NAME="$(grep '^app.versionName=' "${VERSION_FILE}" | cut -d'=' -f2)" - echo "${BASE_APK_FOLDER}"
- VERSION_CODE="$(grep '^app.versionCode=' "${VERSION_FILE}" | cut -d'=' -f2)" - mkdir -p "${BASE_APK_FOLDER}"
- VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
- VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
- APP_NAME="$(grep 'namespace' android/app/build.gradle | cut -d'"' -f2)"
- TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}" - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}"
- echo "${TAG_NAME}" - echo "${TAG_NAME}"
- > - >
...@@ -74,13 +79,20 @@ android:build-release: ...@@ -74,13 +79,20 @@ android:build-release:
else else
flutter packages get flutter packages get
flutter clean flutter clean
flutter build apk --release --split-per-abi
flutter build apk --release flutter build apk --release
fi fi
# prepare artifact # prepare artifact
- find . -name "*.apk" # where is my apk? - >
if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then
for APK in ${BASE_APK_FOLDER}/*.apk; do
mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|" | sed "s|/app-|/${APP_NAME}-|")"
done
fi
- find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk?
artifacts: artifacts:
paths: paths:
- build/app/outputs/apk/release - build/app/outputs/flutter-apk
expire_in: 1 week expire_in: 1 week
interruptible: true interruptible: true
...@@ -100,9 +112,8 @@ application:release: ...@@ -100,9 +112,8 @@ application:release:
- git config user.email "${GITLAB_USER_EMAIL}" - git config user.email "${GITLAB_USER_EMAIL}"
- git config user.name "${GITLAB_USER_NAME}" - git config user.name "${GITLAB_USER_NAME}"
- git remote set-url origin https://oauth2:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH} - git remote set-url origin https://oauth2:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}
- VERSION_FILE="$(find . -name 'gradle.properties' | head -n1)" - VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
- VERSION_NAME="$(grep '^app.versionName=' "${VERSION_FILE}" | cut -d'=' -f2)" - VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
- VERSION_CODE="$(grep '^app.versionCode=' "${VERSION_FILE}" | cut -d'=' -f2)"
- TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}" - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}"
- echo "${TAG_NAME}" - echo "${TAG_NAME}"
- > - >
...@@ -121,4 +132,4 @@ android:deploy: ...@@ -121,4 +132,4 @@ android:deploy:
dependencies: dependencies:
- application:release - application:release
script: script:
- curl "${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN}" - curl "${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN}" --fail
# calculus # snake game
include: package:flutter_lints/flutter.yaml
...@@ -7,5 +7,7 @@ gradle-wrapper.jar ...@@ -7,5 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore. # Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app # See https://flutter.dev/to/reference-keystore
key.properties key.properties
**/*.keystore
**/*.jks
def localProperties = new Properties() plugins {
def localPropertiesFile = rootProject.file('local.properties') id "com.android.application"
if (localPropertiesFile.exists()) { id "kotlin-android"
localPropertiesFile.withReader('UTF-8') { reader -> id "dev.flutter.flutter-gradle-plugin"
localProperties.load(reader)
}
}
def gradleProperties = new Properties()
def gradlePropertiesFile = rootProject.file('gradle.properties')
if (gradlePropertiesFile.exists()) {
gradlePropertiesFile.withReader('UTF-8') { reader ->
gradleProperties.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 appVersionCode = gradleProperties.getProperty('app.versionCode')
if (appVersionCode == null) {
appVersionCode = '1'
}
def appVersionName = gradleProperties.getProperty('app.versionName')
if (appVersionName == null) {
appVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties() def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties') def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) { if (keystorePropertiesFile.exists()) {
...@@ -39,32 +11,69 @@ if (keystorePropertiesFile.exists()) { ...@@ -39,32 +11,69 @@ if (keystorePropertiesFile.exists()) {
} }
android { android {
compileSdkVersion 31 namespace = "org.benoitharrault.snake"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig { defaultConfig {
applicationId "org.benoitharrault.snake" applicationId = "org.benoitharrault.snake"
minSdkVersion 16 minSdk = flutter.minSdkVersion
targetSdkVersion 30 targetSdk = flutter.targetSdkVersion
versionCode appVersionCode.toInteger() versionCode = flutter.versionCode
versionName appVersionName versionName = flutter.versionName
archivesBaseName = "$applicationId" + "_" + "$versionCode"
} }
signingConfigs { signingConfigs {
release { release {
keyAlias keystoreProperties['keyAlias'] keyAlias = keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword'] keyPassword = keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword'] storePassword = keystoreProperties['storePassword']
} }
} }
buildTypes { buildTypes {
release { release {
signingConfig signingConfigs.release signingConfig = signingConfigs.release
}
}
splits {
abi {
reset()
include 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
}
ext.abiCodes = [
'x86': 1,
'x86_64': 2,
'armeabi': 3,
'armeabi-v7a': 4,
'arm64-v8a': 5,
]
import com.android.build.OutputFile
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def perAbiVersionCodeIncrement = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
if (perAbiVersionCodeIncrement != null) {
output.versionCodeOverride = variant.versionCode * 1000 + perAbiVersionCodeIncrement
} }
} }
} }
flutter { flutter {
source '../..' source = "../.."
} }
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="org.benoitharrault.snake">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
</manifest> </manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="org.benoitharrault.snake">
<application <application
android:label="snake" android:label="snake"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
...@@ -27,4 +29,10 @@ ...@@ -27,4 +29,10 @@
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
</application> </application>
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest> </manifest>
package org.benoitharrault.snake;
import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity {
}
package org.benoitharrault.snake
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity()
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" /> <item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here --> <item>
<!-- <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
android:src="@mipmap/launch_image" /> android:src="@mipmap/launch_image" />
</item> --> </item>
</layer-list> </layer-list>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" /> <item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here --> <item>
<!-- <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
android:src="@mipmap/launch_image" /> android:src="@mipmap/launch_image" />
</item> --> </item>
</layer-list> </layer-list>
android/app/src/main/res/mipmap-hdpi/launch_image.png

1.81 KiB

android/app/src/main/res/mipmap-mdpi/launch_image.png

1.21 KiB

android/app/src/main/res/mipmap-xhdpi/launch_image.png

1.87 KiB

android/app/src/main/res/mipmap-xxhdpi/launch_image.png

3.41 KiB

android/app/src/main/res/mipmap-xxxhdpi/launch_image.png

4.47 KiB

<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item> <item name="android:windowBackground">@drawable/launch_background</item>
</style> </style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item> <item name="android:windowBackground">?android:colorBackground</item>
</style> </style>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar"> <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item> <item name="android:windowBackground">@drawable/launch_background</item>
</style> </style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar"> <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item> <item name="android:windowBackground">?android:colorBackground</item>
</style> </style>
......