Skip to content

Commit 64fb114

Browse files
authored
Develop (#13)
Release 3.0.0. with kradle interactive tool and protobuf support.
1 parent d8b9f63 commit 64fb114

File tree

85 files changed

+3810
-1603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3810
-1603
lines changed

.github/workflows/codecov.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ jobs:
1111
- uses: actions/setup-java@v2
1212
with:
1313
distribution: 'zulu'
14-
java-version: '11'
14+
java-version: '17'
1515
- uses: subosito/flutter-action@v2
1616
with:
17+
flutter-version: '3.10.6'
1718
channel: 'stable'
1819

1920
# Get dependencies
@@ -26,7 +27,7 @@ jobs:
2627

2728
# Convert to LCOV
2829
- name: Convert coverage to LCOV
29-
run: dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage.lcov --packages=.dart_tool/package_config.json --report-on=lib
30+
run: dart run coverage:format_coverage --lcov --in=coverage --out=coverage.lcov --packages=.dart_tool/package_config.json --report-on=lib
3031

3132
# Upload coverage data
3233
- name: Upload coverage to Codecov

.github/workflows/native_executable.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
- name: Install dependencies
2020
run: dart pub get
2121
- name: Build executable
22-
run: dart compile exe bin/kradle.dart -o ./kradlew
22+
run: dart compile exe bin/kradle.dart -o kradle
2323
- uses: actions/upload-artifact@v4
2424
with:
25-
name: kradlew
26-
path: ./kradlew.exe
25+
name: kradle-${{ matrix.os }}
26+
path: kradle

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ build/
3434
/resimport.sh
3535
/dartdoc.sh
3636
/example/ridiculous_awesome/
37+
/kradlew
38+
/build_dist.sh

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 3.0.0
2+
* Use klutter_ui 1.1.0.
3+
* Use Klutter Gradle v2024.1.1.beta with support for protobuf.
4+
* Move post-build tasks in root/platform build.gradle.kts to gradle plugin.
5+
* Add kradle script (which replaces producer and consumer).
6+
* Add interactive cli mode.
7+
* Add project create and build tasks.
8+
* Remove producer and consumer scripts.
9+
* Refactor library to enable generating a native executable.
10+
111
## 2.0.0
212
* Uses AGP 8.0.2 in projects.
313
* Removed AndroidManifest.xml references.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021 - 2023 Buijs Software
1+
Copyright (c) 2021 - 2024 Buijs Software
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,27 @@ Use this plugin if you want to:
3535
- [Kradle](https://buijs.dev/kradle-1/) cli tool
3636
- For a step-by-step guide (doing everything manually), see the battery app with Klutter [tutorial](https://buijs.dev/klutter-2/).
3737

38+
Using the IDE plugins or interactive kradle tool are the
39+
preferred options to create projects, as opposed
40+
to doing everything manually. You can install
41+
the kradle tool from git or pub:
42+
43+
```shell
44+
## Get from pub
45+
dart pub global activate klutter
46+
47+
## Get from git
48+
dart pub global activate --source git https://github.com/buijs-dev/klutter-dart.git
49+
50+
## Use it globally
51+
dart pub global run klutter:kradle
52+
```
53+
54+
A native kradle executable is added to the project workspace,
55+
when creating a new project using an IDE plugin.
56+
57+
See the kradle [tutorial](https://buijs.dev/kradle-1/) for usage instructions.
58+
3859
# Installation
3960
<b>What's the point?</b></br>
4061
Plugins build with the Klutter Framework work slightly different from regular plugins.
@@ -45,7 +66,7 @@ Add the Klutter library to dependencies in the pubspec.yaml:
4566

4667
```yaml
4768
dev_dependencies:
48-
klutter: ^2.0.0
69+
klutter: ^3.0.0
4970
```
5071
5172
Then run:
@@ -70,7 +91,7 @@ Install Klutter as dependency as described [here](#Installation).
7091
Initialize Klutter in your project by running:
7192

7293
```shell
73-
flutter pub run klutter:consumer init
94+
dart run klutter:kradle init
7495
```
7596

7697
The init task will set up Klutter for both Android and iOS.
@@ -79,7 +100,7 @@ Klutter plugins can be added by running the add command.
79100
<B>Example</B>:</br> Add the library 'awesome_plugin' to your project:
80101

81102
```shell
82-
flutter pub run klutter:consumer add lib=awesome_plugin
103+
dart run klutter:kradle add lib=awesome_plugin
83104
```
84105

85106
<b>Background</b></br>
@@ -152,33 +173,27 @@ flutter create --org com.example --template=plugin --platforms=android,ios -a ko
152173
Install the Klutter Framework as dependency and then run:
153174

154175
```shell
155-
flutter pub run klutter:producer init
176+
dart run kradle:init
156177
```
157178

158179
Build the platform module by running the following in the root folder (takes a few minutes):
159180

160181
```shell
161-
./gradlew clean build -p "platform"
162-
```
163-
164-
It is also possible to import the kradle tool in your project using Gradle:
165-
166-
```shell
167-
./gradlew klutterGetKradle
182+
dart run klutter:kradle build
168183
```
169184

170-
And then build the project with kradle:
185+
Alternatively use gradle directly with the following command:
171186

172187
```shell
173-
./kradlew build
188+
./gradlew clean build -p "platform"
174189
```
175190

176-
177191
Now test the plugin by following the steps outlined [here](#Usage) in the root/example project.
178192
When done you can run the example project from the root/example/lib folder and see your first plugin in action!
179193

180194
# Faq
181195
1. [App won't start on...](#App%20won't%20start)
196+
2. [Build fails](#build-fails)
182197

183198
## App won't start
184199
Make sure you have followed all the following steps:
@@ -209,4 +224,26 @@ folder.
209224
If there's an error message saying something similiar to '...example/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh: Permission denied'
210225
then try one of:
211226
- delete the Podfile.lock and run pod install in root/example/ios folder.
212-
- run pod deintegrate and then pod install in root/example/ios folder.
227+
- run pod deintegrate and then pod install in root/example/ios folder.
228+
229+
## Build fails
230+
1. [Java toolchain error](#java-toolchain-error)
231+
232+
### Java toolchain error
233+
When you get an error like below, indicating no compatible Java version is detected, make sure you
234+
have the same Java version installed as required by the klutter project.
235+
236+
```shell
237+
* What went wrong:
238+
Could not determine the dependencies of task ':klutter:hello_world:compileDebugKotlinAndroid'.
239+
> No matching toolchains found for requested specification: {languageVersion=17, vendor=any, implementation=vendor-specific}.
240+
> No locally installed toolchains match ...
241+
```
242+
243+
You might also have to add the following plugin to the settings.gradle(.kts) files:
244+
245+
```kotlin
246+
plugins {
247+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0"
248+
}
249+
```

analysis_options.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ analyzer:
55
exclude:
66
- "**/*.g.dart"
77
strong-mode:
8-
implicit-casts: false
9-
implicit-dynamic: false
8+
strict-casts: false
9+
strict-raw-types: false
1010
errors:
1111
# Otherwise cause the import of all_lint_rules to warn because of some rules conflicts.
1212
# We explicitly enabled even conflicting rules and are fixing the conflict in this file

0 commit comments

Comments
 (0)