Skip to content

Commit f790635

Browse files
committed
feat(flutter): init flutter SDK monorepos
init flutter monorepos
1 parent 6bfa6a0 commit f790635

File tree

75 files changed

+1725
-3
lines changed

Some content is hidden

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

75 files changed

+1725
-3
lines changed

.github/workflows/main.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- "push-action/**"
8+
pull_request:
9+
10+
concurrency:
11+
group: main-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
main:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Setup Flutter
22+
uses: subosito/flutter-action@v2
23+
with:
24+
channel: "stable"
25+
26+
- name: Setup Melos
27+
uses: bluefireteam/melos-action@v1 # will run bootstrap by default
28+
29+
- name: analyze
30+
run: melos run analyze
31+
32+
- name: test
33+
run: melos run test

.gitignore

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Miscellaneous
2+
*.class
3+
*.lock
4+
*.log
5+
*.pyc
6+
*.swp
7+
.DS_Store
8+
.atom/
9+
.buildlog/
10+
.history
11+
.svn/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# Visual Studio Code related
20+
.classpath
21+
.project
22+
.settings/
23+
.vscode/
24+
25+
# Flutter repo-specific
26+
/bin/cache/
27+
/bin/internal/bootstrap.bat
28+
/bin/internal/bootstrap.sh
29+
/bin/mingit/
30+
/dev/benchmarks/mega_gallery/
31+
/dev/bots/.recipe_deps
32+
/dev/bots/android_tools/
33+
/dev/devicelab/ABresults*.json
34+
/dev/docs/doc/
35+
/dev/docs/flutter.docs.zip
36+
/dev/docs/lib/
37+
/dev/docs/pubspec.yaml
38+
/dev/integration_tests/**/xcuserdata
39+
/dev/integration_tests/**/Pods
40+
/packages/flutter/coverage/
41+
version
42+
analysis_benchmark.json
43+
44+
# packages file containing multi-root paths
45+
.packages.generated
46+
47+
# Flutter/Dart/Pub related
48+
**/doc/api/
49+
**/.dart_tool/
50+
**/.flutter-plugins
51+
**/.flutter-plugins-dependencies
52+
**/generated_plugin_registrant.dart
53+
**/.packages
54+
**/.pub-cache/
55+
**/.pub/
56+
**/build/
57+
**/flutter_*.png
58+
**/linked_*.ds
59+
**/unlinked.ds
60+
**/unlinked_spec.ds
61+
62+
# Android related
63+
**/android/**/gradle-wrapper.jar
64+
**/.gradle/
65+
**/android/captures/
66+
**/android/gradlew
67+
**/android/gradlew.bat
68+
**/android/local.properties
69+
**/android/**/GeneratedPluginRegistrant.java
70+
**/android/key.properties
71+
*.jks
72+
73+
# iOS/XCode related
74+
**/ios/**/*.mode1v3
75+
**/ios/**/*.mode2v3
76+
**/ios/**/*.moved-aside
77+
**/ios/**/*.pbxuser
78+
**/ios/**/*.perspectivev3
79+
**/ios/**/*sync/
80+
**/ios/**/.sconsign.dblite
81+
**/ios/**/.tags*
82+
**/ios/**/.vagrant/
83+
**/ios/**/DerivedData/
84+
**/ios/**/Icon?
85+
**/ios/**/Pods/
86+
**/ios/**/.symlinks/
87+
**/ios/**/profile
88+
**/ios/**/xcuserdata
89+
**/ios/.generated/
90+
**/ios/Flutter/.last_build_id
91+
**/ios/Flutter/App.framework
92+
**/ios/Flutter/Flutter.framework
93+
**/ios/Flutter/Flutter.podspec
94+
**/ios/Flutter/Generated.xcconfig
95+
**/ios/Flutter/ephemeral
96+
**/ios/Flutter/app.flx
97+
**/ios/Flutter/app.zip
98+
**/ios/Flutter/flutter_assets/
99+
**/ios/Flutter/flutter_export_environment.sh
100+
**/ios/ServiceDefinitions.json
101+
**/ios/Runner/GeneratedPluginRegistrant.*
102+
103+
# macOS
104+
**/Flutter/ephemeral/
105+
**/Pods/
106+
**/macos/Flutter/GeneratedPluginRegistrant.swift
107+
**/macos/Flutter/ephemeral
108+
**/xcuserdata/
109+
110+
# Coverage
111+
**/coverage/
112+
113+
# Symbols
114+
app.*.symbols

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Logto
3+
Copyright (c) 2022 Silverhand Inc.
44

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

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1-
# flutter
2-
flutter SDK of Logto and demo apps
1+
<p align="center">
2+
<a href="https://logto.io" target="_blank" align="center" alt="Logto Logo">
3+
<img src="./logo.png" width="100">
4+
</a>
5+
<br/>
6+
<span><i><a href="https://logto.io" target="_blank">Logto</a> helps you quickly focus on everything after signing in.</i></span>
7+
</p>
8+
9+
# Logto Flutter SDKs
10+
11+
The monorepo for SDKs and demo apps wrote in Flutter.

melos.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: logto_dart_sdk
2+
3+
packages:
4+
- packages/**
5+
6+
repository: https://github.com/logto-io/dart.git
7+
8+
command:
9+
bootstrap:
10+
usePubspecOverrides: true
11+
12+
scripts:
13+
test:selective_unit_test:
14+
run: melos exec --dir-exists="test" --fail-fast -- flutter test --no-pub --coverage
15+
description: Run Flutter tests for a specific package in this project.
16+
select-package:
17+
flutter: true
18+
dir-exists: test
19+
test:
20+
run: melos run test:selective_unit_test --no-select
21+
description: Run all Flutter tests in this
22+
23+
analyze:
24+
run: melos exec -- flutter analyze .
25+
description: Run `dart analyze` in all packages.
26+
27+
ide:
28+
intellij: false

packages/flutter_sample/.metadata

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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.
5+
6+
version:
7+
revision: f1875d570e39de09040c8f79aa13cc56baab8db1
8+
channel: stable
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
17+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
18+
- platform: android
19+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
20+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
21+
- platform: ios
22+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
23+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
24+
# User provided section
25+
26+
# List of Local paths (relative to this file) that should be
27+
# ignored by the migrate tool.
28+
#
29+
# Files that are not part of the templates will be ignored by default.
30+
unmanaged_files:
31+
- "lib/main.dart"
32+
- "ios/Runner.xcodeproj/project.pbxproj"

packages/flutter_sample/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# flutter_sample
2+
3+
A new Flutter project.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter application.
8+
9+
A few resources to get you started if this is your first Flutter project:
10+
11+
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13+
14+
For help getting started with Flutter development, view the
15+
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
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+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
26+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
28+
android {
29+
compileSdkVersion flutter.compileSdkVersion
30+
ndkVersion flutter.ndkVersion
31+
32+
compileOptions {
33+
sourceCompatibility JavaVersion.VERSION_1_8
34+
targetCompatibility JavaVersion.VERSION_1_8
35+
}
36+
37+
kotlinOptions {
38+
jvmTarget = '1.8'
39+
}
40+
41+
sourceSets {
42+
main.java.srcDirs += 'src/main/kotlin'
43+
}
44+
45+
defaultConfig {
46+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47+
applicationId "com.example.flutter_sample"
48+
// You can update the following values to match your application needs.
49+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50+
minSdkVersion flutter.minSdkVersion
51+
targetSdkVersion flutter.targetSdkVersion
52+
versionCode flutterVersionCode.toInteger()
53+
versionName flutterVersionName
54+
}
55+
56+
buildTypes {
57+
release {
58+
// TODO: Add your own signing config for the release build.
59+
// Signing with the debug keys for now, so `flutter run --release` works.
60+
signingConfig signingConfigs.debug
61+
}
62+
}
63+
}
64+
65+
flutter {
66+
source '../..'
67+
}
68+
69+
dependencies {
70+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
71+
}

0 commit comments

Comments
 (0)