Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Nov 24, 2023
1 parent 096fab6 commit f322dcc
Show file tree
Hide file tree
Showing 35 changed files with 321 additions and 249 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/patrol-prepare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
- name: Preload Flutter artifacts
run: flutter precache --ios

- name: Generate iOS build files
- name: Generate iOS build filesP
working-directory: packages/patrol/example
run: flutter build ios --config-only --simulator

Expand Down
16 changes: 6 additions & 10 deletions dev/e2e_app/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

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"
Expand All @@ -21,10 +22,6 @@ if (flutterVersionName == null) {
flutterVersionName = "1.0"
}

apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdk 33
namespace "pl.leancode.patrol.e2e_app"
Expand All @@ -49,7 +46,6 @@ android {

buildTypes {
release {
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
Expand Down
24 changes: 4 additions & 20 deletions dev/e2e_app/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
buildscript {
ext.kotlin_version = "1.8.22"
repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
31 changes: 23 additions & 8 deletions dev/e2e_app/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
include ":app"
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()

includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
plugins {
id "dev.flutter.flutter-plugin-loader"
id "com.android.application" version "7.4.2" apply false
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
include ":app"
20 changes: 9 additions & 11 deletions packages/patrol/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +13,6 @@ if (localPropertiesFile.exists()) {
}
}

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'
Expand All @@ -21,15 +23,11 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
ndkVersion flutter.ndkVersion

namespace "pl.leancode.patrol.challenge"
namespace "pl.leancode.patrol.example"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -45,7 +43,7 @@ android {
}

defaultConfig {
applicationId "pl.leancode.patrol.challenge"
applicationId "pl.leancode.patrol.example"
minSdkVersion 21
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
Expand Down
62 changes: 62 additions & 0 deletions packages/patrol/example/android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"project_info": {
"project_number": "1084522097392",
"project_id": "REMOVED",
"storage_bucket": "REMOVED.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1084544027393:android:a954abb91299778a2c8ff0",
"android_client_info": {
"package_name": "pl.leancode.patrol.example"
}
},
"oauth_client": [
{
"client_id": "1082544097392-j48pqr8dkg4almagua8er7hcl86el0df.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "pl.leancode.patrol.example",
"certificate_hash": "04c4d550315e88f469e252e20d08aa7bf07d8657"
}
},
{
"client_id": "1084144097393-vu46lsrqbkenn0kid9r469668m6rtd0.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "pl.leancode.patrol.Example",
"certificate_hash": "77d5797c5c5481afe34d78ef8153d59cfd44f951"
}
},
{
"client_id": "1084544097393-7fu46orccluulnfv0cjq3rvtv9e4op3q.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyChbKtvpnU9dvaI4U69_HHEd8mjb1ehx0o"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1084544097393-7fu46orccluullfv0cjq5rvtv9e8op3q.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "1084544094393-1n4pqvqcni14ihhkbgl5oda9ufg9c6gf.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "pl.leancode.patrol.Example"
}
}
]
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.leancode.patrol.challenge;
package pl.leancode.patrol.example;

import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.leancode.patrol.challenge
package pl.leancode.patrol.example

import io.flutter.embedding.android.FlutterActivity

Expand Down
27 changes: 2 additions & 25 deletions packages/patrol/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
buildscript {
ext.kotlin_version = '1.7.20'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.1.2'
classpath 'com.google.gms:google-services:4.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
32 changes: 24 additions & 8 deletions packages/patrol/example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader"
id "com.android.application" version "8.1.2" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
}

include ":app"
2 changes: 1 addition & 1 deletion packages/patrol/example/integration_test/empty_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:example/main.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';
import 'package:patrol_challenge/main.dart';

void main() {
patrolTest(
Expand Down
8 changes: 4 additions & 4 deletions packages/patrol/example/integration_test/main_test.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:example/main.dart';
import 'package:example/pages/quiz/form_page.dart';
import 'package:example/ui/components/button/elevated_button.dart';
import 'package:example/ui/style/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';
import 'package:patrol_challenge/main.dart';
import 'package:patrol_challenge/pages/quiz/form_page.dart';
import 'package:patrol_challenge/ui/components/button/elevated_button.dart';
import 'package:patrol_challenge/ui/style/colors.dart';

void main() {
patrolTest('main flow', ($) async {
Expand Down
Loading

0 comments on commit f322dcc

Please sign in to comment.