From 46ca74c62bcc056163192d7d2148e7c7c9a86d45 Mon Sep 17 00:00:00 2001 From: v7lin Date: Fri, 17 May 2019 11:49:54 +0800 Subject: [PATCH] xxx --- .drone.yml | 40 ++++++++++++++++---- CHANGELOG.md | 8 ++-- example/android/app/proguard-rules.pro | 8 ++++ example/ios/Runner.xcodeproj/project.pbxproj | 14 +++++-- lib/src/weibo.dart | 4 +- lib/src/weibo_provider.dart | 22 ----------- pubspec.yaml | 10 ++--- 7 files changed, 61 insertions(+), 45 deletions(-) create mode 100644 example/android/app/proguard-rules.pro delete mode 100644 lib/src/weibo_provider.dart diff --git a/.drone.yml b/.drone.yml index 504e6ea..401aabb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,7 @@ name: default steps: - name: prepare - image: v7lin/flutter:1.2.1-stable + image: v7lin/flutter:1.5.4-hotfix.2-stable volumes: - name: pub-cache path: /opt/flutter/.pub-cache @@ -11,7 +11,7 @@ steps: - flutter packages get #- name: build_runner -# image: v7lin/flutter:1.2.1-stable +# image: v7lin/flutter:1.5.4-hotfix.2-stable # volumes: # - name: pub-cache # path: /opt/flutter/.pub-cache @@ -19,7 +19,7 @@ steps: # - flutter packages pub run build_runner build - name: format - image: v7lin/flutter:1.2.1-stable + image: v7lin/flutter:1.5.4-hotfix.2-stable volumes: - name: pub-cache path: /opt/flutter/.pub-cache @@ -27,7 +27,7 @@ steps: - flutter format --dry-run --set-exit-if-changed . - name: analyze - image: v7lin/flutter:1.2.1-stable + image: v7lin/flutter:1.5.4-hotfix.2-stable volumes: - name: pub-cache path: /opt/flutter/.pub-cache @@ -35,23 +35,47 @@ steps: - flutter analyze - name: test - image: v7lin/flutter:1.2.1-stable + image: v7lin/flutter:1.5.4-hotfix.2-stable volumes: - name: pub-cache path: /opt/flutter/.pub-cache commands: - - flutter test - - pushd example/ + - flutter test --coverage + - cd example/ - flutter test +- name: proguard + image: v7lin/flutter:1.5.4-hotfix.2-stable + volumes: + - name: pub-cache + path: /opt/flutter/.pub-cache + - name: gradle + path: /root/.gradle + commands: + - cd example/ + - flutter build apk + +- name: coverage + image: plugins/codecov:2.0.3 + settings: + token: + from_secret: CODECOV_TOKEN + files: + - ./coverage/lcov.info + - name: publish-check - image: v7lin/flutter:1.2.1-stable + image: v7lin/flutter:1.5.4-hotfix.2-stable volumes: - name: pub-cache path: /opt/flutter/.pub-cache commands: - flutter packages pub publish --dry-run + when: + event: + - tag volumes: - name: pub-cache temp: {} +- name: gradle + temp: {} diff --git a/CHANGELOG.md b/CHANGELOG.md index c2bd281..b46b8a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ -## [0.0.1] - 2019.3.5 - -* android/ios weibo - ## [0.1.0] - 2019.3.19 * 规范 library 代码 + +## [0.0.1] - 2019.3.5 + +* android/ios weibo diff --git a/example/android/app/proguard-rules.pro b/example/android/app/proguard-rules.pro new file mode 100644 index 0000000..a52c689 --- /dev/null +++ b/example/android/app/proguard-rules.pro @@ -0,0 +1,8 @@ +#Flutter Wrapper +-keep class io.flutter.app.** { *; } +-keep class io.flutter.plugin.** { *; } +-keep class io.flutter.util.** { *; } +-keep class io.flutter.view.** { *; } +-keep class io.flutter.** { *; } +-keep class io.flutter.plugins.** { *; } +-dontwarn io.flutter.** \ No newline at end of file diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index b1fd172..f740e55 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -40,8 +40,10 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3329B2A78B4C4B969972BA19 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; + 40991B03E162E46C56B9D900 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -54,6 +56,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 983F5802E11ABE4DB378B222 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; CC78EBE1496BEBD8B37D6CBF /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -74,6 +77,9 @@ 118CEF9B5D8D03B56D5D7C1F /* Pods */ = { isa = PBXGroup; children = ( + 3329B2A78B4C4B969972BA19 /* Pods-Runner.debug.xcconfig */, + 983F5802E11ABE4DB378B222 /* Pods-Runner.release.xcconfig */, + 40991B03E162E46C56B9D900 /* Pods-Runner.profile.xcconfig */, ); name = Pods; sourceTree = ""; @@ -223,7 +229,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", "${PODS_ROOT}/Weibo_SDK/libWeiboSDK/WeiboSDK.bundle", ); name = "[CP] Copy Pods Resources"; @@ -232,7 +238,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { @@ -287,7 +293,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -296,7 +302,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/lib/src/weibo.dart b/lib/src/weibo.dart index 5105055..93969ae 100644 --- a/lib/src/weibo.dart +++ b/lib/src/weibo.dart @@ -33,8 +33,8 @@ class Weibo { static const String _DEFAULT_REDIRECTURL = 'https://api.weibo.com/oauth2/default.html'; - static const MethodChannel _channel = - MethodChannel('v7lin.github.io/fake_weibo'); + final MethodChannel _channel = + const MethodChannel('v7lin.github.io/fake_weibo'); final StreamController _authRespStreamController = StreamController.broadcast(); diff --git a/lib/src/weibo_provider.dart b/lib/src/weibo_provider.dart deleted file mode 100644 index aa8a641..0000000 --- a/lib/src/weibo_provider.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:fake_weibo/src/weibo.dart'; -import 'package:flutter/widgets.dart'; - -class WeiboProvider extends InheritedWidget { - WeiboProvider({ - Key key, - @required this.weibo, - @required Widget child, - }) : super(key: key, child: child); - - final Weibo weibo; - - @override - bool updateShouldNotify(InheritedWidget oldWidget) { - WeiboProvider oldProvider = oldWidget as WeiboProvider; - return weibo != oldProvider.weibo; - } - - static WeiboProvider of(BuildContext context) { - return context.inheritFromWidgetOfExactType(WeiboProvider) as WeiboProvider; - } -} diff --git a/pubspec.yaml b/pubspec.yaml index e1714a6..627fb04 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fake_weibo description: A powerful weibo plugin for Flutter. -version: 0.1.0 +version: 0.2.0 author: v7lin homepage: https://github.com/v7lin/fake_weibo @@ -11,9 +11,9 @@ dependencies: flutter: sdk: flutter - meta: ^1.1.6 + meta: '>=1.1.6' - jaguar_serializer: ^2.2.12 + jaguar_serializer: '>=2.2.12 <3.0.0' dev_dependencies: flutter_test: @@ -21,8 +21,8 @@ dev_dependencies: pedantic: '>=1.4.0 <3.0.0' - build_runner: ^1.2.3 - jaguar_serializer_cli: ^2.2.5 + build_runner: + jaguar_serializer_cli: # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec