Enable alias parsing flutter_project_dir and Update Ci (#92)

This commit is contained in:
wenchieh
2023-05-24 23:57:53 +08:00
committed by GitHub
parent bbce20d4f8
commit 3a62daf897
6 changed files with 19 additions and 8 deletions

View File

@ -23,7 +23,7 @@ jobs:
- run: clang-format -style=file -i ios/Classes/*.h ios/Classes/*.m --dry-run --Werror - run: clang-format -style=file -i ios/Classes/*.h ios/Classes/*.m --dry-run --Werror
- run: flutter --version - run: flutter --version
- run: flutter pub get - run: flutter pub get
- run: flutter format --dry-run --set-exit-if-changed . - run: dart format --set-exit-if-changed .
- run: flutter pub publish --dry-run - run: flutter pub publish --dry-run
- run: flutter analyze lib example/lib - run: flutter analyze lib example/lib
- run: cd example; flutter build ios --no-codesign - run: cd example; flutter build ios --no-codesign
@ -46,7 +46,7 @@ jobs:
channel: 'stable' channel: 'stable'
- run: flutter --version - run: flutter --version
- run: flutter pub get - run: flutter pub get
- run: flutter format --dry-run --set-exit-if-changed . - run: dart format --set-exit-if-changed .
- run: flutter pub publish --dry-run - run: flutter pub publish --dry-run
- run: flutter analyze lib example/lib - run: flutter analyze lib example/lib
- run: cd example; flutter build apk --debug - run: cd example; flutter build apk --debug

View File

@ -25,7 +25,7 @@ jobs:
echo $CREDENTIALS > $PUB_CACHE/credentials.json echo $CREDENTIALS > $PUB_CACHE/credentials.json
- run: flutter --version - run: flutter --version
- run: flutter pub get - run: flutter pub get
- run: flutter format --dry-run --set-exit-if-changed . - run: dart format --set-exit-if-changed .
- run: echo "y" | flutter pub publish - run: echo "y" | flutter pub publish
- name: Run pub.dev/update-credentials@shell - name: Run pub.dev/update-credentials@shell
env: env:

View File

@ -8,7 +8,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+100 version: 1.0.0+100
environment: environment:
sdk: ">=2.17.0 <3.0.0" sdk: ">=2.17.0 <4.0.0"
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions

View File

@ -10,7 +10,15 @@ current_dir = Dir.pwd
calling_dir = File.dirname(__FILE__) calling_dir = File.dirname(__FILE__)
project_dir = calling_dir.slice(0..(calling_dir.index('/.symlinks'))) project_dir = calling_dir.slice(0..(calling_dir.index('/.symlinks')))
flutter_project_dir = calling_dir.slice(0..(calling_dir.index('/ios/.symlinks'))) flutter_project_dir = calling_dir.slice(0..(calling_dir.index('/ios/.symlinks')))
cfg = YAML.load_file(File.join(flutter_project_dir, 'pubspec.yaml'))
psych_version_gte_500 = Gem::Version.new(Psych::VERSION) >= Gem::Version.new('5.0.0')
if psych_version_gte_500 == true
cfg = YAML.load_file(File.join(flutter_project_dir, 'pubspec.yaml'), aliases: true)
else
cfg = YAML.load_file(File.join(flutter_project_dir, 'pubspec.yaml'))
end
if cfg['tencent_kit'] && cfg['tencent_kit']['app_id'] if cfg['tencent_kit'] && cfg['tencent_kit']['app_id']
app_id = cfg['tencent_kit']['app_id'] app_id = cfg['tencent_kit']['app_id']
universal_link = cfg['tencent_kit']['universal_link'] universal_link = cfg['tencent_kit']['universal_link']

View File

@ -7,7 +7,7 @@ repository: https://github.com/RxReader/tencent_kit.git
issue_tracker: https://github.com/RxReader/tencent_kit/issues issue_tracker: https://github.com/RxReader/tencent_kit/issues
environment: environment:
sdk: ">=2.17.0 <3.0.0" sdk: ">=2.17.0 <4.0.0"
flutter: ">=2.5.0" flutter: ">=2.5.0"
dependencies: dependencies:

View File

@ -9,16 +9,19 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
setUp(() { setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, (MethodCall methodCall) async {
switch (methodCall.method) { switch (methodCall.method) {
case 'isQQInstalled': case 'isQQInstalled':
return true; return true;
} }
return null;
}); });
}); });
tearDown(() { tearDown(() {
channel.setMockMethodCallHandler(null); TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, null);
}); });
test('isQQInstalled', () async { test('isQQInstalled', () async {