Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrysbita committed Nov 24, 2024
1 parent bc7c0bd commit 34ba917
Show file tree
Hide file tree
Showing 30 changed files with 525 additions and 293 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: "microsoft"
java-version: "11"
java-version: "17"
java-package: jdk
- uses: subosito/flutter-action@v2
with:
channel: beta
- name: Setup OpenCV
run: |
wget "https://github.com/opencv/opencv/releases/download/4.8.0/opencv-4.8.0-android-sdk.zip" -O ./third_party/opencv-android/opencv.zip
wget "https://github.com/opencv/opencv/releases/download/4.10.0/opencv-4.10.0-android-sdk.zip" -O ./third_party/opencv-android/opencv.zip
unzip ./third_party/opencv-android/opencv.zip -d ./third_party/opencv-android/
mv ./third_party/opencv-android/OpenCV-android-sdk/sdk ./third_party/opencv-android/sdk
- name: Build
run: flutter build apk --release
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: SnakeEye-android
path: build/app/outputs/flutter-apk/app-release.apk
8 changes: 4 additions & 4 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
Build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: beta
- name: Setup OpenCV
run: |
Start-BitsTransfer -Source "https://github.com/opencv/opencv/releases/download/4.8.0/opencv-4.8.0-windows.exe" -Destination ".\third_party\opencv.exe"
Start-BitsTransfer -Source "https://github.com/opencv/opencv/releases/download/4.10.0/opencv-4.10.0-windows.exe" -Destination ".\third_party\opencv.exe"
Start-Process -FilePath .\third_party\opencv.exe -ArgumentList "-y" -Wait
Move-Item .\third_party\opencv\build .\third_party\opencv-windows\build
- name: Build
run: |
git config --global core.longpaths true
flutter build windows --release
Move-Item .\third_party\opencv-windows\build\x64\vc16\bin\opencv_world480.dll .\build\windows\runner\Release\opencv_world480.dll
- uses: actions/upload-artifact@v3
Move-Item .\third_party\opencv-windows\build\x64\vc16\bin\opencv_world4100.dll .\build\windows\x64\runner\Release\opencv_world4100.dll
- uses: actions/upload-artifact@v4
with:
name: SnakeEye-win
path: build/windows/runner/Release
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand All @@ -29,7 +31,6 @@ migrate_working_dir/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
Expand Down
18 changes: 9 additions & 9 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
revision: "fc011960a2b3260d49b64823b90fe292440c78ee"
channel: "beta"

project_type: app
Expand All @@ -13,17 +13,17 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
base_revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
create_revision: fc011960a2b3260d49b64823b90fe292440c78ee
base_revision: fc011960a2b3260d49b64823b90fe292440c78ee
- platform: android
create_revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
base_revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
create_revision: fc011960a2b3260d49b64823b90fe292440c78ee
base_revision: fc011960a2b3260d49b64823b90fe292440c78ee
- platform: macos
create_revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
base_revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
create_revision: fc011960a2b3260d49b64823b90fe292440c78ee
base_revision: fc011960a2b3260d49b64823b90fe292440c78ee
- platform: windows
create_revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
base_revision: 9b4416aaa79bf984d06aa40ab515a274a50a75a7
create_revision: fc011960a2b3260d49b64823b90fe292440c78ee
base_revision: fc011960a2b3260d49b64823b90fe292440c78ee

# User provided section

Expand Down
2 changes: 1 addition & 1 deletion android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java

# 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
**/*.keystore
**/*.jks
Expand Down
55 changes: 16 additions & 39 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,51 +1,30 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

android {
namespace 'io.xdea.snake_eye'
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace = "io.xdea.snake_eye"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "io.xdea.SnakeEye"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
applicationId = "io.xdea.SnakeEye"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName

ndk {
if (!project.hasProperty('target-platform')) {
Expand All @@ -69,20 +48,18 @@ android {
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
signingConfig = signingConfigs.debug
}
}

externalNativeBuild {
cmake {
path file('src/main/cpp/CMakeLists.txt')
version '3.22.1'
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}
}

flutter {
source '../..'
source = "../.."
}

dependencies {}
12 changes: 12 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand Down Expand Up @@ -38,4 +39,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ package io.xdea.snake_eye

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
class MainActivity: FlutterActivity()
17 changes: 2 additions & 15 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.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
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
19 changes: 12 additions & 7 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ pluginManagement {
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")
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

plugins {
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

include ":app"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
include ":app"
6 changes: 3 additions & 3 deletions lib/connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Connection {
final BinaryCodec<TypedMessage> codec;
final BinaryChannel channel;

const Connection({
Connection({
required this.channel,
this.codec = const JSONTypedMessageBinaryCodec(),
});
BinaryCodec<TypedMessage>? codec,
}) : codec = codec ?? TypedMessageBinaryCodec();

/// Establish connection to device.
Future<void> connect() async {
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main() {
}

class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
const App({super.key});

@override
Widget build(BuildContext context) {
Expand Down
6 changes: 3 additions & 3 deletions lib/opencv_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class OpenCVPage extends StatefulWidget {
final Connection connection;

const OpenCVPage({
Key? key,
super.key,
required this.connection,
}) : super(key: key);
});

@override
State<OpenCVPage> createState() => _OpenCVPageState();
Expand Down Expand Up @@ -171,7 +171,7 @@ class _OpenCVPageState extends State<OpenCVPage> {
margin: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Theme.of(context).cardColor.withOpacity(0.6),
color: Theme.of(context).cardColor.withValues(alpha: 0.6),
borderRadius: BorderRadius.circular(8),
),
child: Text(
Expand Down
6 changes: 3 additions & 3 deletions lib/pixels_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class PixelsPage extends StatefulWidget {
final Connection connection;

const PixelsPage({
Key? key,
super.key,
required this.connection,
}) : super(key: key);
});

@override
State<PixelsPage> createState() => _PixelsPageState();
Expand Down Expand Up @@ -148,7 +148,7 @@ class _PixelsPageState extends State<PixelsPage> {
margin: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Theme.of(context).cardColor.withOpacity(0.6),
color: Theme.of(context).cardColor.withValues(alpha: 0.6),
borderRadius: BorderRadius.circular(8),
),
child: Text(
Expand Down
5 changes: 4 additions & 1 deletion macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.11'
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -31,6 +31,9 @@ target 'Runner' do
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
Expand Down
Loading

0 comments on commit 34ba917

Please sign in to comment.