Compare commits
No commits in common. "d157673aac92a38d58c62d199ba3c00f9784ee5b" and "202bdab66628d88bff3b46822056e045ae4443e1" have entirely different histories.
d157673aac
...
202bdab666
61
Jenkinsfile
vendored
61
Jenkinsfile
vendored
|
@ -7,28 +7,17 @@ pipeline {
|
||||||
buildDiscarder(logRotator(numToKeepStr: '10'))
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||||
}
|
}
|
||||||
parameters {
|
parameters {
|
||||||
string(name: 'APP_PACKAGE_ID', defaultValue: 'com.charlyghislain.embedded_webview', description: 'Application package id used as android identifier')
|
|
||||||
string(name: 'APP_BUNDLE_ID', defaultValue: 'com.charlyghislain.embedded_webview', description: 'Application bundle id used as ios identifier')
|
|
||||||
string(name: 'APP_TITLE', defaultValue: 'Embedded Webview', description: 'Application title')
|
string(name: 'APP_TITLE', defaultValue: 'Embedded Webview', description: 'Application title')
|
||||||
string(name: 'APP_URI', defaultValue: 'https://www.charlyghislain.com', description: 'Application initial uri')
|
string(name: 'APP_URI', defaultValue: 'https://www.charlyghislain.com', description: 'Application uri')
|
||||||
string(name: 'APP_COLOR', defaultValue: 'red', description: 'Application color (blue, teal, ...)')
|
string(name: 'APP_COLOR', defaultValue: 'red', description: 'Application color (blue, teal, ...)')
|
||||||
string(name: 'BUILD_MODE', defaultValue: 'debug', description: 'Flutter build mode (debug/release)')
|
string(name: 'BUILD_MODE', defaultValue: 'debug', description: 'Flutter build mode (debug/release)')
|
||||||
string(name: 'ANDROID_SIGNING_KEYSTORE_CREDENTIAL', defaultValue: 'jenkins-gestemps-android-service-secret-keystore',
|
string(name: 'UPLOAD_TRACK', defaultValue: 'alpha', description: 'Upload track')
|
||||||
string(name: 'ANDROID_SIGNING_KEYSTORE_PASSWORD_CREDENTIAL', defaultValue: 'jenkins-gestemps-android-service-secret-keystore-password',
|
|
||||||
string(name: 'ANDROID_SIGNING_KEY_PASSWORD_CREDENTIAL', defaultValue: 'jenkins-gestemps-android-service-secret-key-password',
|
|
||||||
string(name: 'ANDROID_SIGNING_KEY_ALIAS', defaultValue: 'comptaplan',
|
|
||||||
description: 'The key alias to use within the keystore')
|
|
||||||
booleanParam(name: 'SKIP_PUBLISH', defaultValue: 'true', description: 'Skip publishing apk')
|
|
||||||
string(name: 'RELEASE_MESSAGE', defaultValue: 'Nouvelle version', description: 'A release message')
|
string(name: 'RELEASE_MESSAGE', defaultValue: 'Nouvelle version', description: 'A release message')
|
||||||
string(name: 'ANDROID_UPLOAD_TRACK', defaultValue: 'alpha', description: 'Upload track')
|
string(name: 'RELEASE_STATUS', defaultValue: 'completed', description: 'draft/completed')
|
||||||
string(name: 'ANDROID_RELEASE_STATUS', defaultValue: 'completed', description: 'draft/completed')
|
booleanParam(name: 'SKIP_PUBLISH', defaultValue: 'true', description: 'Skip publishing apk')
|
||||||
string(name: 'ANDROID_API_KEY_CREDENTIAL', defaultValue: 'jenkins-gestemps-android-service-secret-api-key', description: 'Api key to for the play store api')
|
|
||||||
string(name: 'GIT_SSH_REMOTE_NAME', defaultValue: 'ssh://git@gitea.valuya.com:2022/Valuya/embedded_webview.git',
|
|
||||||
description: 'We use ssh authentication, but gitea may use an http remotes by default. This is the remote to push the build number increment.')
|
|
||||||
string(name: 'GIT_CREDENTIAL_ID', defaultValue: 'jenkins-jenkins-ssh-key', description: '')
|
string(name: 'GIT_CREDENTIAL_ID', defaultValue: 'jenkins-jenkins-ssh-key', description: '')
|
||||||
string(name: 'GIT_PUSH_BRANCH', defaultValue: 'android-releases', description: 'A branch to push the commit')
|
string(name: 'GIT_PUSH_BRANCH', defaultValue: 'android-releases', description: 'A branch to push the commit')
|
||||||
string(name: 'GIT_TAG', defaultValue: '', description: 'An additional tag to push')
|
string(name: 'GIT_TAG', defaultValue: '', description: 'An additional tag to push')
|
||||||
string(name: 'SSH_KNOWN_HOSTS_FILE', defaultValue: '/var/run/ssh/known_hosts.gitea.valuya.com', description: 'Known hosts for ssh client (might be used to get flutter git dependencies and push commits)')
|
|
||||||
booleanParam(name: 'SKIP_PUSH_TAG', defaultValue: 'true', description: 'Skip push tag')
|
booleanParam(name: 'SKIP_PUSH_TAG', defaultValue: 'true', description: 'Skip push tag')
|
||||||
string(name: 'NODEJS_INSTALLATION', defaultValue: 'node14',description: 'Nodejs installation to use')
|
string(name: 'NODEJS_INSTALLATION', defaultValue: 'node14',description: 'Nodejs installation to use')
|
||||||
}
|
}
|
||||||
|
@ -36,31 +25,18 @@ pipeline {
|
||||||
stage ('Build') {
|
stage ('Build') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
env.APP_PACKAGE_ID= params.APP_PACKAGE_ID
|
|
||||||
env.APP_BUNDLE_ID= params.APP_BUNDLE_ID
|
|
||||||
env.APP_TITLE= params.APP_TITLE
|
env.APP_TITLE= params.APP_TITLE
|
||||||
env.APP_URI= params.APP_URI
|
env.APP_URI= params.APP_URI
|
||||||
env.APP_COLOR= params.APP_COLOR
|
env.APP_COLOR= params.APP_COLOR
|
||||||
env.BUILD_MODE= params.BUILD_MODE
|
env.BUILD_MODE= params.BUILD_MODE
|
||||||
env.SSH_KNOWN_HOSTS_FILE= params.SSH_KNOWN_HOSTS_FILE
|
|
||||||
env.ANDROID_KEY_ALIAS= params.ANDROID_SIGNING_KEY_ALIAS
|
|
||||||
}
|
}
|
||||||
container ('flutter') {
|
container ('flutter') {
|
||||||
sshagent(["${params.GIT_CREDENTIAL_ID}"]) {
|
sshagent(["${params.GIT_CREDENTIAL_ID}"]) {
|
||||||
withCredentials([
|
sh 'flutter doctor'
|
||||||
file(credentialsId: params.ANDROID_SIGNING_KEYSTORE_CREDENTIAL, variable: 'ANDROID_KEYSTORE_FILE'),
|
sh 'GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/var/run/ssh/known_hosts.gitea.fteamdev.valuya.be" flutter pub get'
|
||||||
string(credentialsId: params.ANDROID_SIGNING_KEYSTORE_PASSWORD_CREDENTIAL, variable: 'ANDROID_KEYSTORE_PASSWORD')
|
sh 'flutter clean'
|
||||||
string(credentialsId: params.ANDROID_SIGNING_KEY_PASSWORD_CREDENTIAL, variable: 'ANDROID_KEY_PASSWORD')
|
sh 'APP_TITLE="$APP_TITLE" APP_URI="$APP_URI" APP_COLOR="$APP_COLOR" BUILDMODE="$BUILD_MODEs" ./tools/jenkins-build-android.sh'
|
||||||
]) {
|
stash(name: 'outputs', includes: 'build/app/outputs/**')
|
||||||
sh 'flutter doctor'
|
|
||||||
sh 'GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE" flutter pub get'
|
|
||||||
sh 'flutter clean'
|
|
||||||
sh './tools/set-bundle-identifier.sh "$APP_BUNDLE_ID"'
|
|
||||||
sh './tools/set-package.sh "$APP_PACKAGE_ID"'
|
|
||||||
sh './tools/set-title.sh "$APP_TITLE"'
|
|
||||||
sh './tools/jenkins-build-android.sh'
|
|
||||||
stash(name: 'outputs', includes: 'build/app/outputs/**')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,31 +51,24 @@ pipeline {
|
||||||
env.SKIP_PUSH_TAG= params.SKIP_PUSH_TAG
|
env.SKIP_PUSH_TAG= params.SKIP_PUSH_TAG
|
||||||
env.GIT_TAG= params.GIT_TAG
|
env.GIT_TAG= params.GIT_TAG
|
||||||
env.GIT_PUSH_BRANCH = params.GIT_PUSH_BRANCH
|
env.GIT_PUSH_BRANCH = params.GIT_PUSH_BRANCH
|
||||||
env.ANDROID_UPLOAD_TRACK = params.ANDROID_UPLOAD_TRACK
|
env.TRACK = params.UPLOAD_TRACK
|
||||||
env.ANDROID_RELEASE_STATUS = params.ANDROID_RELEASE_STATUS
|
env.RELEASE_STATUS = params.RELEASE_STATUS
|
||||||
env.RELEASE_MESSAGE = params.RELEASE_MESSAGE
|
env.RELEASE_MESSAGE = params.RELEASE_MESSAGE
|
||||||
env.GIT_SSH_REMOTE_NAME = params.GIT_SSH_REMOTE_NAME
|
|
||||||
env.SSH_KNOWN_HOSTS_FILE = params.SSH_KNOWN_HOSTS_FILE
|
|
||||||
}
|
}
|
||||||
unstash(name: 'outputs')
|
unstash(name: 'outputs')
|
||||||
sshagent(["${params.GIT_CREDENTIAL_ID}"]) {
|
sshagent(["${params.GIT_CREDENTIAL_ID}"]) {
|
||||||
nodejs(nodeJSInstallationName: "${params.NODEJS_INSTALLATION}") {
|
nodejs(nodeJSInstallationName: "${params.NODEJS_INSTALLATION}") {
|
||||||
withCredentials([
|
sh './tools/jenkins-publish-android.sh'
|
||||||
file(credentialsId: params.ANDROID_API_KEY_CREDENTIAL, variable: 'GOOGLE_APPLICATION_CREDENTIALS')
|
|
||||||
]) {
|
|
||||||
sh './tools/jenkins-publish-android.sh'
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
sh '''
|
sh '''
|
||||||
VERSION_CODE=$(./tools/jenkins-increment-buildnumber.sh || echo $?)
|
VERSION_CODE=$(./tools/jenkins-increment-buildnumber.sh || echo $?)
|
||||||
[ "$VERSION_CODE" == "0" ] && exit 1
|
[ "$VERSION_CODE" == "0" ] && exit 1
|
||||||
git config user.email "jenkins@valuya.com"
|
git config user.email "jenkins@valuya.be"
|
||||||
git config user.name "Jenkins release"
|
git config user.name "Jenkins release"
|
||||||
git add pubspec.yaml
|
git add pubspec.yaml
|
||||||
git remote add ssh "$GIT_SSH_REMOTE_NAME"
|
git remote add ssh "ssh://git@gitea.fteamdev.valuya.be:2022/fiscalteam/nitro-trustee-mobile.git"
|
||||||
git commit -m "Bump to build $VERSION_CODE"
|
git commit -m "Bump to build $VERSION_CODE"
|
||||||
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE"
|
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/var/run/ssh/known_hosts.gitea.fteamdev.valuya.be"
|
||||||
git push ssh HEAD:$GIT_PUSH_BRANCH
|
git push ssh HEAD:$GIT_PUSH_BRANCH
|
||||||
if [ "$SKIP_PUSH_TAG" != "true" ] ; then
|
if [ "$SKIP_PUSH_TAG" != "true" ] ; then
|
||||||
git tag "$GIT_TAG"
|
git tag "$GIT_TAG"
|
||||||
|
|
|
@ -41,10 +41,6 @@ android {
|
||||||
main.java.srcDirs += 'src/main/kotlin'
|
main.java.srcDirs += 'src/main/kotlin'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation 'com.google.android.material:material:1.4.0'
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "com.charlyghislain.embedded_webview"
|
applicationId "com.charlyghislain.embedded_webview"
|
||||||
|
@ -53,17 +49,12 @@ android {
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
signingConfigs {
|
|
||||||
release {
|
|
||||||
keyAlias keystoreProperties['keyAlias']
|
|
||||||
keyPassword keystoreProperties['keyPassword']
|
|
||||||
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
|
||||||
storePassword keystoreProperties['storePassword']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
signingConfig signingConfigs.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.debug
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.charlyghislain.embedded_webview">
|
package="com.charlyghislain.embedded_webview">
|
||||||
|
<application
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
<uses-permission android:name="android.permission.CAMERA"/>
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:label="embedded_webview"
|
android:label="embedded_webview"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:embedded_webview/webview_widget.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
const title = String.fromEnvironment("APP_TITLE");
|
const title = String.fromEnvironment("APP_TITLE");
|
||||||
|
@ -18,8 +18,16 @@ class MyApp extends StatelessWidget {
|
||||||
// This widget is the root of your application.
|
// This widget is the root of your application.
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
MaterialColor materialColor = _getMaterialColor(_color);
|
MaterialColor materialColor = this._getMaterialColor(this._color);
|
||||||
return MaterialApp(title: _title, theme: ThemeData(primarySwatch: materialColor), home: WebViewWidget(_uri));
|
return MaterialApp(
|
||||||
|
title: this._title,
|
||||||
|
theme: ThemeData(primarySwatch: materialColor),
|
||||||
|
home: WebView(
|
||||||
|
initialUrl: this._uri,
|
||||||
|
javascriptMode: JavascriptMode.unrestricted,
|
||||||
|
zoomEnabled: true,
|
||||||
|
allowsInlineMediaPlayback: true,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialColor _getMaterialColor(String colorString) {
|
MaterialColor _getMaterialColor(String colorString) {
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_webview_pro/webview_flutter.dart';
|
|
||||||
|
|
||||||
class WebViewWidget extends StatefulWidget {
|
|
||||||
final String _initialUrl;
|
|
||||||
|
|
||||||
const WebViewWidget(this._initialUrl, {Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
WebViewWidgetState createState() => WebViewWidgetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class WebViewWidgetState extends State<WebViewWidget> {
|
|
||||||
WebViewWidgetState();
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
// Enable hybrid composition.
|
|
||||||
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return WebView(
|
|
||||||
initialUrl: widget._initialUrl,
|
|
||||||
javascriptMode: JavascriptMode.unrestricted,
|
|
||||||
javascriptChannels: <JavascriptChannel>{
|
|
||||||
_toasterJavascriptChannel(context),
|
|
||||||
},
|
|
||||||
gestureNavigationEnabled: true,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
|
|
||||||
return JavascriptChannel(
|
|
||||||
name: 'Toaster',
|
|
||||||
onMessageReceived: (JavascriptMessage message) {
|
|
||||||
// ignore: deprecated_member_use
|
|
||||||
Scaffold.of(context).showSnackBar(
|
|
||||||
SnackBar(content: Text(message.message)),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
46
pubspec.lock
46
pubspec.lock
|
@ -74,13 +74,6 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
flutter_webview_pro:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_webview_pro
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.0"
|
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -109,6 +102,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.8.0"
|
||||||
|
plugin_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: plugin_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -170,6 +170,34 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
webview_flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: webview_flutter
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.1"
|
||||||
|
webview_flutter_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_android
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.1"
|
||||||
|
webview_flutter_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.5.1"
|
||||||
|
webview_flutter_wkwebview:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_wkwebview
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
flutter: ">=1.22.0"
|
flutter: ">=2.5.0"
|
||||||
|
|
|
@ -34,9 +34,7 @@ dependencies:
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
#webview_flutter: ^2.3.1
|
webview_flutter: ^2.3.1
|
||||||
flutter_webview_pro: ^1.0.0
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
|
@ -13,7 +13,7 @@ import 'package:embedded_webview/main.dart';
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||||
// Build our app and trigger a frame.
|
// Build our app and trigger a frame.
|
||||||
await tester.pumpWidget(const MyApp('test', 'test', 'blue'));
|
await tester.pumpWidget(const MyApp());
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
// Verify that our counter starts at 0.
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
|
|
@ -1,30 +1,26 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# debug/release
|
# debug/release
|
||||||
BUILD_MODE=${BUILD_MODE:-debug}
|
BUILDMODE=${BUILDMODE:-debug}
|
||||||
# LOCAL/DEV/PROD
|
# LOCAL/DEV/PROD
|
||||||
APP_TITLE=${APP_TITLE:-}
|
APP_TITLE=${APP_TITLE:-}
|
||||||
APP_URI=${APP_URI:-}
|
APP_URI=${APP_URI:-}
|
||||||
APP_COLOR=${APP_COLOR:-}
|
APP_COLOR=${APP_COLOR:-}
|
||||||
ANDROID_KEYSTORE_FILE=${ANDROID_KEYSTORE_FILE:-}
|
|
||||||
ANDROID_KEY_ALIAS=${ANDROID_KEY_ALIAS:-}
|
|
||||||
ANDROID_KEYSTORE_PASSWORD=${ANDROID_KEYSTORE_PASSWORD:-}
|
|
||||||
ANDROID_KEY_PASSWORD=${ANDROID_KEY_PASSWORD:-}
|
|
||||||
|
|
||||||
|
|
||||||
cat << EOF > android/local.properties
|
cat << EOF > android/local.properties
|
||||||
flutter.sdk=/home/developer/flutter
|
flutter.sdk=/home/developer/flutter
|
||||||
sdk.dir=/home/developer/android
|
sdk.dir=/home/developer/android
|
||||||
flutter.buildMode=${BUILD_MODE}
|
flutter.buildMode=${BUILDMODE}
|
||||||
flutter.versionName=
|
flutter.versionName=
|
||||||
flutter.versionCode=
|
flutter.versionCode=
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat << EOF > android/key.properties
|
cat << EOF > android/key.properties
|
||||||
storePassword=${ANDROID_KEYSTORE_PASSWORD}
|
storePassword=jenkins.fteamdev
|
||||||
keyPassword=${ANDROID_KEY_PASSWORD}
|
keyPassword=jenkins.fteamdev
|
||||||
keyAlias=${ANDROID_SIGNING_KEY_ALIAS}
|
keyAlias=jenkins.fteamdev
|
||||||
storeFile=${ANDROID_KEYSTORE_FILE}
|
storeFile=/var/run/secrets/signing_keystore.jks
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
pwd
|
pwd
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
TRACK=${TRACK:-alpha}
|
TRACK=${TRACK:-alpha}
|
||||||
RELEASE_STATUS=${RELEASE_STATUS:-completed}
|
RELEASE_STATUS=${RELEASE_STATUS:-completed}
|
||||||
RELEASE_MESSAGE="${RELEASE_MESSAGE:-New version}"
|
RELEASE_MESSAGE="${RELEASE_MESSAGE:-New version}"
|
||||||
GOOGLE_APPLICATION_CREDENTIALS="${GOOGLE_APPLICATION_CREDENTIALS:-}"
|
|
||||||
|
|
||||||
|
|
||||||
VERSION_AND_CODE="$(cat pubspec.yaml | grep 'version:' | sed 's/version: //')"
|
VERSION_AND_CODE="$(cat pubspec.yaml | grep 'version:' | sed 's/version: //')"
|
||||||
|
@ -20,6 +19,7 @@ npm install
|
||||||
./node_modules/.bin/tsc
|
./node_modules/.bin/tsc
|
||||||
npm install -g --save googleapis
|
npm install -g --save googleapis
|
||||||
|
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS=/var/run/secrets/google_api.key.json \
|
||||||
node ${WD}/publish-android-js/publish-app-store.js \
|
node ${WD}/publish-android-js/publish-app-store.js \
|
||||||
"$TRACK" "$VERSION_CODE" "$RELEASE_STATUS" "$VERSION_CODE $VERISON_NAME" "$RELEASE_MESSAGE" ${WD}/../build/app/outputs/bundle/release/app-release.aab \
|
"$TRACK" "$VERSION_CODE" "$RELEASE_STATUS" "$VERSION_CODE $VERISON_NAME" "$RELEASE_MESSAGE" ${WD}/../build/app/outputs/bundle/release/app-release.aab \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
BUNDLE_NAME="$1"
|
|
||||||
|
|
||||||
echo "Setting the ios bundle name to $BUNDLE_NAME"
|
|
||||||
|
|
||||||
sed -i "s/PRODUCT_BUNDLE_IDENTIFIER = .*;/PRODUCT_BUNDLE_IDENTIFIER = $BUNDLE_NAME;" ios/Runner.xcodeproj/project.pbxproj
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
PACKAGE="$1"
|
|
||||||
|
|
||||||
echo "Setting the application android package to $PACKAGE"
|
|
||||||
|
|
||||||
sed -i "s/package=\"[^\"]\+\"/package=\"$PACKAGE\"/" android/app/src/debug/AndroidManfest.xml
|
|
||||||
sed -i "s/package=\"[^\"]\+\"/package=\"$PACKAGE\"/" android/app/src/main/AndroidManfest.xml
|
|
||||||
sed -i "s/package=\"[^\"]\+\"/package=\"$PACKAGE\"/" android/app/src/profile/AndroidManfest.xml
|
|
||||||
|
|
||||||
sed -i "s/applicationId \"[^\"]\+\"/applicationId \"$PACKAGE\"/" android/app/build.gradle
|
|
||||||
|
|
||||||
sed -i "s/package .*/package $PACKAGE/" android/app/src/main/kotlin/com/charlyghislain/embedded_webview/MainActivity.kt
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
TITLE="$1"
|
|
||||||
|
|
||||||
echo "Setting the application title to $TITLE"
|
|
||||||
|
|
||||||
sed -i "s/android:label=\"[^\"]\+\"/android:label=\"$TITLE\"/" android/app/src/main/AndroidManfest.xml
|
|
||||||
|
|
||||||
NAME_LENGTH="${#TITLE}"
|
|
||||||
LONG_NAME="$(( $NAME_LENGTH > 15))" # 1 if long name
|
|
||||||
BUNDLE_NAME="$(cut -c -15 $TITLE)"
|
|
||||||
|
|
||||||
perl -0777 -i -pe "s/\t<key>CFBundleName</key>\n[^\n]+/\t<key>CFBundleName</key>\n\t<string>$BUNDLE_NAME</string>/igs"
|
|
||||||
|
|
||||||
if [ "$LONG_NAME" = "1" ] ; then
|
|
||||||
# todo : set bundleDisplayName
|
|
||||||
fi
|
|
||||||
|
|
Reference in New Issue
Block a user