Skip to content

Commit ba32061

Browse files
fixed conflict
2 parents 8299329 + dedd497 commit ba32061

8 files changed

Lines changed: 88 additions & 38 deletions

File tree

.github/workflows/publish.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,68 @@
1+
name: Flutter Package Release
2+
13
on:
4+
# Manual trigger with version input
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'New version (e.g., v1.0.0)'
9+
required: true
10+
release_note:
11+
description: 'Release notes'
12+
required: true
13+
# Automated trigger on main branch
214
release:
315
branches:
416
- main
17+
518
jobs:
19+
# Job to update changelog and create release
20+
prepare-release:
21+
runs-on: ubuntu-latest
22+
# Only run this job if triggered manually
23+
if: github.event_name == 'workflow_dispatch'
24+
steps:
25+
- uses: actions/checkout@v2
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Update CHANGELOG.md
30+
run: |
31+
echo "## ${{ github.event.inputs.version }} - $(date +'%Y-%m-%d')" >> temp_changelog.md
32+
echo "${{ github.event.inputs.release_note }}" >> temp_changelog.md
33+
echo "" >> temp_changelog.md
34+
cat CHANGELOG.md >> temp_changelog.md
35+
mv temp_changelog.md CHANGELOG.md
36+
37+
- name: Commit and Push Changes
38+
run: |
39+
git config --local user.email "action@github.com"
40+
git config --local user.name "GitHub Action"
41+
git add CHANGELOG.md
42+
git commit -m "Update changelog for ${{ github.event.inputs.version }}"
43+
git tag ${{ github.event.inputs.version }}
44+
git push
45+
git push --tags
46+
47+
# Job to build and publish package
648
build:
749
runs-on: ubuntu-latest
50+
needs: [prepare-release]
51+
if: always() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch')
852
steps:
953
- uses: actions/checkout@v2
54+
with:
55+
ref: ${{ github.event_name == 'workflow_dispatch' && github.sha || github.event.release.tag_name }}
56+
1057
- name: Install Flutter
1158
uses: subosito/flutter-action@v2
59+
1260
- name: Install dependencies
1361
run: flutter pub get
62+
1463
- name: Format code
1564
run: dart format --fix .
65+
1666
- name: Publish
1767
uses: k-paxian/dart-package-publisher@v1.5.1
1868
with:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
## 0.3.1
22
* Fixed MissingPluginException [PR #116](https://github.com/CodingWithTashi/simple_barcode_scanner/pull/116)
33

4+
## 0.3.1
5+
* Removes FlutterActivity reference
6+
* Migrates to applying Gradle plugins (https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply)
47
## 0.3.0
58
* Removes references to Flutter v1 Android embedding classes
69
## 0.2.6

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Window | Web
3333
## Getting started
3434

3535
```dart
36-
simple_barcode_scanner: ^0.2.0
36+
simple_barcode_scanner: ^0.3.1
3737
3838
```
3939
Import the library:

android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
public class FlutterBarcodeScannerPlugin implements MethodCallHandler, ActivityResultListener, StreamHandler, FlutterPlugin, ActivityAware {
4040
private static final String CHANNEL = "flutter_barcode_scanner";
4141

42-
private static FlutterActivity activity;
42+
private static Activity activity;
4343
private static Result pendingResult;
4444
private Map<String, Object> arguments;
4545

@@ -256,7 +256,7 @@ private void createPluginSetup(
256256
final ActivityPluginBinding activityBinding) {
257257

258258

259-
this.activity = (FlutterActivity) activity;
259+
this.activity = activity;
260260
eventChannel =
261261
new EventChannel(messenger, "flutter_barcode_scanner_receiver");
262262
eventChannel.setStreamHandler(this);

example/android/app/build.gradle

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,14 +22,10 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
2926
compileSdkVersion 35
30-
//ndkVersion flutter.ndkVersion
31-
ndkVersion = "25.1.8937393"
27+
ndkVersion flutter.ndkVersion
28+
// ndkVersion = "25.1.8937393"
3229
namespace "com.kharagedition.example"
3330
compileOptions {
3431
sourceCompatibility JavaVersion.VERSION_1_8
@@ -67,5 +64,4 @@ flutter {
6764
}
6865

6966
dependencies {
70-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7167
}

example/android/build.gradle

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.8.0'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:8.3.2'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
@@ -28,4 +15,4 @@ subprojects {
2815

2916
tasks.register("clean", Delete) {
3017
delete rootProject.buildDir
31-
}
18+
}

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

example/android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true
21+
id "com.android.application" version '8.8.0' apply false
22+
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
23+
}
24+
25+
include ":app"

0 commit comments

Comments
 (0)