Merge branch 'build_runner/flutter_gen' into dev

This commit is contained in:
Leptopoda 2021-10-14 16:03:34 +02:00
commit ca2d26a70f
No known key found for this signature in database
GPG Key ID: 661B059EDE309F11
4 changed files with 31 additions and 19 deletions

View File

@ -15,15 +15,19 @@ flutter pub get
flutter pub global activate intl_utils flutter pub global activate intl_utils
flutter --no-color pub global run intl_utils:generate flutter --no-color pub global run intl_utils:generate
flutter pub run flutter_oss_licenses:generate.dart flutter pub run flutter_oss_licenses:generate.dart
mv lib/oss_licenses.dart lib/generated mv lib/oss_licenses.dart lib/generated
mkdir -p $GEN_FILE_PATH || true mkdir -p "$GEN_FILE_PATH" || true
echo "const Map<String, String> flutterVersion =" > $FLUTTER_VERSION_FILE echo "const Map<String, String> flutterVersion =" >"$FLUTTER_VERSION_FILE"
flutter --version --machine >> $FLUTTER_VERSION_FILE flutter --version --machine >>"$FLUTTER_VERSION_FILE"
echo ";" >> $FLUTTER_VERSION_FILE echo ";" >>"$FLUTTER_VERSION_FILE"
mkdir -p $ENV_FILE_PATH || true mkdir -p "$ENV_FILE_PATH" || true
touch $ENV_FILE touch "$ENV_FILE"
export > $ENV_FILE export >"$ENV_FILE"
flutter pub global activate build_runner
flutter pub run build_runner build --delete-conflicting-outputs

View File

@ -20,6 +20,7 @@ import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:sanmill/generated/assets/assets.gen.dart';
import 'package:sanmill/shared/common/config.dart'; import 'package:sanmill/shared/common/config.dart';
import 'package:soundpool/soundpool.dart'; import 'package:soundpool/soundpool.dart';
import 'package:stack_trace/stack_trace.dart'; import 'package:stack_trace/stack_trace.dart';
@ -62,43 +63,43 @@ class Audios {
} }
_drawSoundId = await _soundpool.load( _drawSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/draw.mp3"), await rootBundle.load(Assets.audios.draw),
); );
_flySoundId = await _soundpool.load( _flySoundId = await _soundpool.load(
await rootBundle.load("assets/audios/fly.mp3"), await rootBundle.load(Assets.audios.fly),
); );
_goSoundId = await _soundpool.load( _goSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/go.mp3"), await rootBundle.load(Assets.audios.go),
); );
_illegalSoundId = await _soundpool.load( _illegalSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/illegal.mp3"), await rootBundle.load(Assets.audios.illegal),
); );
_loseSoundId = await _soundpool.load( _loseSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/lose.mp3"), await rootBundle.load(Assets.audios.lose),
); );
_millSoundId = await _soundpool.load( _millSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/mill.mp3"), await rootBundle.load(Assets.audios.mill),
); );
_placeSoundId = await _soundpool.load( _placeSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/place.mp3"), await rootBundle.load(Assets.audios.place),
); );
_removeSoundId = await _soundpool.load( _removeSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/remove.mp3"), await rootBundle.load(Assets.audios.remove),
); );
_selectSoundId = await _soundpool.load( _selectSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/select.mp3"), await rootBundle.load(Assets.audios.select),
); );
_winSoundId = await _soundpool.load( _winSoundId = await _soundpool.load(
await rootBundle.load("assets/audios/win.mp3"), await rootBundle.load(Assets.audios.win),
); );
_initialized = true; _initialized = true;

View File

@ -17,6 +17,7 @@
*/ */
import 'dart:ui'; import 'dart:ui';
import 'package:sanmill/generated/assets/assets.gen.dart';
class Constants { class Constants {
const Constants._(); const Constants._();
@ -29,8 +30,8 @@ class Constants {
static String settingsFilename = "${projectNameLower}_settings.json"; static String settingsFilename = "${projectNameLower}_settings.json";
static String crashLogsFileName = "$projectName-crash-logs.txt"; static String crashLogsFileName = "$projectName-crash-logs.txt";
static String environmentVariablesFilename = static String environmentVariablesFilename =
"assets/files/environment_variables.txt"; Assets.files.environmentVariables;
static String gplLicenseFilename = "assets/licenses/GPL-3.0.txt"; static String gplLicenseFilename = Assets.licenses.gpl30;
static String defaultLanguageCodeName = "Default"; static String defaultLanguageCodeName = "Default";

View File

@ -36,12 +36,18 @@ dependencies:
#screen_recorder: ^0.0.2 #screen_recorder: ^0.0.2
dev_dependencies: dev_dependencies:
build_runner: ^2.1.4
flutter_gen_runner: ^4.0.0
flutter_oss_licenses: ^1.0.1 flutter_oss_licenses: ^1.0.1
flutter_test: flutter_test:
sdk: flutter sdk: flutter
lint: ^1.7.2 lint: ^1.7.2
msix: ^2.1.3 msix: ^2.1.3
flutter_gen:
output: lib/generated/assets/
flutter: flutter:
generate: true generate: true
uses-material-design: true uses-material-design: true