Skip to content

Commit 859e85c

Browse files
committed
Add Flutter packages for build scripts
1 parent 096ca11 commit 859e85c

Some content is hidden

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

56 files changed

+814
-53
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ jobs:
3737
test:
3838
strategy:
3939
matrix:
40-
os: [ubuntu-latest, windows-latest, macOS-latest]
40+
# os: [ubuntu-latest, windows-latest, macOS-latest]
41+
# todo: Figure out why macOS isn't working
42+
os: [ubuntu-latest, windows-latest]
4143
dart: [dev]
4244

4345
runs-on: ${{ matrix.os }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ build/
1414
doc/api/
1515

1616
.vscode/
17-
.idea/
17+
.idea/
18+
19+
.flutter-plugins
20+
.flutter-plugins-dependencies

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Simon Binder
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

slcipher_flutter_libs/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
.dart_tool/
3+
4+
.packages
5+
.pub/
6+
7+
build/

slcipher_flutter_libs/.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 8fe7655ed20ffd1395f68e30539a847a01a30351
8+
channel: beta
9+
10+
project_type: plugin

slcipher_flutter_libs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

slcipher_flutter_libs/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Simon Binder
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

slcipher_flutter_libs/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# sqlcipher_flutter_libs
2+
3+
This package intentionally contains no Dart code. Flutter apps depending on this package will
4+
contain native `SQLCipher` libraries.
5+
6+
For more details on how to actually use this package in a Flutter app, see
7+
[sqlite3](https://pub.dev/packages/sqlite3).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
group 'eu.simonbinder.sqlite3_flutter_libs'
2+
version '1.0'
3+
4+
buildscript {
5+
repositories {
6+
google()
7+
jcenter()
8+
}
9+
10+
dependencies {
11+
classpath 'com.android.tools.build:gradle:3.5.0'
12+
}
13+
}
14+
15+
rootProject.allprojects {
16+
repositories {
17+
google()
18+
jcenter()
19+
}
20+
}
21+
22+
apply plugin: 'com.android.library'
23+
24+
android {
25+
compileSdkVersion 28
26+
27+
defaultConfig {
28+
minSdkVersion 16
29+
}
30+
lintOptions {
31+
disable 'InvalidPackage'
32+
}
33+
}
34+
35+
dependencies {
36+
implementation "net.zetetic:android-database-sqlcipher:4.4.0"
37+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
org.gradle.jvmargs=-Xmx1536M
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'sqlite3_flutter_libs'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.sqlite3_flutter_libs">
3+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package eu.simonbinder.sqlite3_flutter_libs;
2+
3+
import io.flutter.embedding.engine.plugins.FlutterPlugin;
4+
5+
/** Sqlite3FlutterLibsPlugin */
6+
public class Sqlite3FlutterLibsPlugin implements FlutterPlugin {
7+
8+
@Override
9+
public void onAttachedToEngine(FlutterPluginBinding binding) {
10+
// Do nothing, we only need the native libraries.
11+
}
12+
13+
@Override
14+
public void onDetachedFromEngine(FlutterPluginBinding binding) {
15+
// Again, nothing to do here.
16+
}
17+
18+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
We only have this example because otherwise `flutter packages get` in `sqlite3_flutter_libs` fails.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: sqlite3_flutter_libs_example
2+
description: Demonstrates how to use the sqlite3_flutter_libs plugin.
3+
4+
# The following line prevents the package from being accidentally published to
5+
# pub.dev using `pub publish`. This is preferred for private packages.
6+
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7+
8+
environment:
9+
sdk: ">=2.7.0 <3.0.0"
10+
11+
dependencies:
12+
flutter:
13+
sdk: flutter
14+
15+
sqlite3_flutter_libs:
16+
# When depending on this package from a real application you should use:
17+
# sqlite3_flutter_libs: ^x.y.z
18+
# See https://dart.dev/tools/pub/dependencies#version-constraints
19+
# The example app is bundled with the plugin so we use a path dependency on
20+
# the parent directory to use the current plugin's version.
21+
path: ../
22+
23+
# The following adds the Cupertino Icons font to your application.
24+
# Use with the CupertinoIcons class for iOS style icons.
25+
cupertino_icons: ^0.1.3
26+
27+
dev_dependencies:
28+
flutter_test:
29+
sdk: flutter
30+
31+
# For information on the generic Dart part of this file, see the
32+
# following page: https://dart.dev/tools/pub/pubspec
33+
34+
# The following section is specific to Flutter.
35+
flutter:
36+
37+
# The following line ensures that the Material Icons font is
38+
# included with your application, so that you can use the icons in
39+
# the material Icons class.
40+
uses-material-design: true
41+
42+
# To add assets to your application, add an assets section, like this:
43+
# assets:
44+
# - images/a_dot_burr.jpeg
45+
# - images/a_dot_ham.jpeg
46+
47+
# An image asset can refer to one or more resolution-specific "variants", see
48+
# https://flutter.dev/assets-and-images/#resolution-aware.
49+
50+
# For details regarding adding assets from package dependencies, see
51+
# https://flutter.dev/assets-and-images/#from-packages
52+
53+
# To add custom fonts to your application, add a fonts section here,
54+
# in this "flutter" section. Each entry in this list should have a
55+
# "family" key with the font family name, and a "fonts" key with a
56+
# list giving the asset and other descriptors for the font. For
57+
# example:
58+
# fonts:
59+
# - family: Schyler
60+
# fonts:
61+
# - asset: fonts/Schyler-Regular.ttf
62+
# - asset: fonts/Schyler-Italic.ttf
63+
# style: italic
64+
# - family: Trajan Pro
65+
# fonts:
66+
# - asset: fonts/TrajanPro.ttf
67+
# - asset: fonts/TrajanPro_Bold.ttf
68+
# weight: 700
69+
#
70+
# For details regarding fonts from package dependencies,
71+
# see https://flutter.dev/custom-fonts/#from-packages

slcipher_flutter_libs/ios/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.idea/
2+
.vagrant/
3+
.sconsign.dblite
4+
.svn/
5+
6+
.DS_Store
7+
*.swp
8+
profile
9+
10+
DerivedData/
11+
build/
12+
GeneratedPluginRegistrant.h
13+
GeneratedPluginRegistrant.m
14+
15+
.generated/
16+
17+
*.pbxuser
18+
*.mode1v3
19+
*.mode2v3
20+
*.perspectivev3
21+
22+
!default.pbxuser
23+
!default.mode1v3
24+
!default.mode2v3
25+
!default.perspectivev3
26+
27+
xcuserdata
28+
29+
*.moved-aside
30+
31+
*.pyc
32+
*sync/
33+
Icon?
34+
.tags*
35+
36+
/Flutter/Generated.xcconfig
37+
/Flutter/flutter_export_environment.sh

slcipher_flutter_libs/ios/Assets/.gitkeep

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#import <Flutter/Flutter.h>
2+
3+
@interface Sqlite3FlutterLibsPlugin : NSObject<FlutterPlugin>
4+
@end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#import "Sqlite3FlutterLibsPlugin.h"
2+
#if __has_include(<sqlite3_flutter_libs/sqlite3_flutter_libs-Swift.h>)
3+
#import <sqlite3_flutter_libs/sqlite3_flutter_libs-Swift.h>
4+
#else
5+
// Support project import fallback if the generated compatibility header
6+
// is not copied when this plugin is created as a library.
7+
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
8+
#import "sqlite3_flutter_libs-Swift.h"
9+
#endif
10+
11+
@implementation Sqlite3FlutterLibsPlugin
12+
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
13+
[SwiftSqlite3FlutterLibsPlugin registerWithRegistrar:registrar];
14+
}
15+
@end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Flutter
2+
import UIKit
3+
4+
public class SwiftSqlite3FlutterLibsPlugin: NSObject, FlutterPlugin {
5+
public static func register(with registrar: FlutterPluginRegistrar) {
6+
// No need to do anything at runtime, we only care about the build script
7+
}
8+
9+
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
10+
result("iOS " + UIDevice.current.systemVersion)
11+
}
12+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
3+
# Run `pod lib lint sqlite3_flutter_libs.podspec' to validate before publishing.
4+
#
5+
Pod::Spec.new do |s|
6+
s.name = 'sqlite3_flutter_libs'
7+
s.version = '0.0.1'
8+
s.summary = 'A new flutter plugin project.'
9+
s.description = <<-DESC
10+
A new flutter plugin project.
11+
DESC
12+
s.homepage = 'http://example.com'
13+
s.license = { :file => '../LICENSE' }
14+
s.author = { 'Your Company' => '[email protected]' }
15+
s.source = { :path => '.' }
16+
s.source_files = 'Classes/**/*'
17+
s.dependency 'Flutter'
18+
s.dependency 'SQLCipher', '~> 4.4.0'
19+
s.platform = :ios, '8.0'
20+
21+
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
22+
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
23+
s.swift_version = '5.0'
24+
end

slcipher_flutter_libs/pubspec.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: sqlcipher_flutter_libs
2+
description: Flutter plugin to include native sqlite3 libraries with your app
3+
version: 0.0.1
4+
homepage: https://github.com/simolus3/sqlite3.dart/
5+
6+
environment:
7+
sdk: ">=2.7.0 <3.0.0"
8+
flutter: ">=1.10.1"
9+
10+
flutter:
11+
plugin:
12+
# We use the same class names as sqlite3_flutter_libs since users should never depend on both packages at the same
13+
# time, not even transitively.
14+
platforms:
15+
android:
16+
package: eu.simonbinder.sqlite3_flutter_libs
17+
pluginClass: Sqlite3FlutterLibsPlugin
18+
ios:
19+
pluginClass: Sqlite3FlutterLibsPlugin

sqlite3/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Simon Binder
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)