diff --git a/brick/__brick__/{{project_name.snakeCase()}}/.gitignore b/brick/__brick__/{{project_name.snakeCase()}}/.gitignore index 6cfdc51..25a05ff 100644 --- a/brick/__brick__/{{project_name.snakeCase()}}/.gitignore +++ b/brick/__brick__/{{project_name.snakeCase()}}/.gitignore @@ -1,6 +1,5 @@ # Miscellaneous *.class -*.lock *.log *.pyc *.swp @@ -9,6 +8,7 @@ .buildlog/ .history .svn/ +migrate_working_dir/ # IntelliJ related *.iml @@ -22,21 +22,6 @@ .settings/ .vscode/* -# Flutter repo-specific -/bin/cache/ -/bin/mingit/ -/dev/benchmarks/mega_gallery/ -/dev/bots/.recipe_deps -/dev/bots/android_tools/ -/dev/docs/doc/ -/dev/docs/flutter.docs.zip -/dev/docs/lib/ -/dev/docs/pubspec.yaml -/dev/integration_tests/**/xcuserdata -/dev/integration_tests/**/Pods -/packages/flutter/coverage/ -version - # packages file containing multi-root paths .packages.generated @@ -60,12 +45,13 @@ unlinked_spec.ds **/android/**/gradle-wrapper.jar **/android/.gradle **/android/captures/ -**/android/gradlew -**/android/gradlew.bat **/android/local.properties **/android/**/GeneratedPluginRegistrant.java **/android/key.properties **/android/.idea/ +**/android/app/debug +**/android/app/profile +**/android/app/release *.jks # iOS/XCode related diff --git a/brick/__brick__/{{project_name.snakeCase()}}/.metadata b/brick/__brick__/{{project_name.snakeCase()}}/.metadata index cd984dd..620e877 100644 --- a/brick/__brick__/{{project_name.snakeCase()}}/.metadata +++ b/brick/__brick__/{{project_name.snakeCase()}}/.metadata @@ -4,7 +4,42 @@ # This file should be version controlled and should not be manually edited. version: - revision: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 - channel: stable + revision: "ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + - platform: android + create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + - platform: ios + create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + - platform: linux + create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + - platform: macos + create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + - platform: web + create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + - platform: windows + create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/brick/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml b/brick/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml index 559f4eb..b0e602e 100644 --- a/brick/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml +++ b/brick/__brick__/{{project_name.snakeCase()}}/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.5.0.0.yaml +include: package:very_good_analysis/analysis_options.5.1.0.yaml analyzer: exclude: - lib/gen/* diff --git a/brick/__brick__/{{project_name.snakeCase()}}/android/.gitignore b/brick/__brick__/{{project_name.snakeCase()}}/android/.gitignore index 6f56801..d6aa291 100644 --- a/brick/__brick__/{{project_name.snakeCase()}}/android/.gitignore +++ b/brick/__brick__/{{project_name.snakeCase()}}/android/.gitignore @@ -1,8 +1,6 @@ gradle-wrapper.jar /.gradle /captures/ -/gradlew -/gradlew.bat /local.properties GeneratedPluginRegistrant.java diff --git a/brick/__brick__/{{project_name.snakeCase()}}/android/gradlew b/brick/__brick__/{{project_name.snakeCase()}}/android/gradlew new file mode 100755 index 0000000..9d82f78 --- /dev/null +++ b/brick/__brick__/{{project_name.snakeCase()}}/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/brick/__brick__/{{project_name.snakeCase()}}/android/gradlew.bat b/brick/__brick__/{{project_name.snakeCase()}}/android/gradlew.bat new file mode 100644 index 0000000..aec9973 --- /dev/null +++ b/brick/__brick__/{{project_name.snakeCase()}}/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/brick/__brick__/{{project_name.snakeCase()}}/ios/Runner.xcodeproj/project.pbxproj b/brick/__brick__/{{project_name.snakeCase()}}/ios/Runner.xcodeproj/project.pbxproj index a1fdcac..f54f52f 100644 --- a/brick/__brick__/{{project_name.snakeCase()}}/ios/Runner.xcodeproj/project.pbxproj +++ b/brick/__brick__/{{project_name.snakeCase()}}/ios/Runner.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 23E03CFD37C19AD6FA90E914 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BE2306F8C5E4765C97FA07E /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 3CDABF3C2AB33ED20076008C /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CDABF3B2AB33ED20076008C /* RunnerTests.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; @@ -34,6 +35,7 @@ 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 = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3CDABF3B2AB33ED20076008C /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 4DC06FF104E93BAA5C197AF2 /* Pods-Runner.profile-development.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-development.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-development.xcconfig"; sourceTree = ""; }; 5BE2306F8C5E4765C97FA07E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 67EF0EFFAA3BB6B4D157BD0D /* Pods-Runner.debug-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-production.xcconfig"; sourceTree = ""; }; @@ -67,6 +69,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3CDABF3A2AB33E8A0076008C /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 3CDABF3B2AB33ED20076008C /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -81,6 +91,7 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( + 3CDABF3A2AB33E8A0076008C /* RunnerTests */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, @@ -133,7 +144,6 @@ 4DC06FF104E93BAA5C197AF2 /* Pods-Runner.profile-development.xcconfig */, 9E048A3BB1728F26C6D45EA3 /* Pods-Runner.profile-staging.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -288,6 +298,7 @@ buildActionMask = 2147483647; files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 3CDABF3C2AB33ED20076008C /* RunnerTests.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/brick/__brick__/{{project_name.snakeCase()}}/ios/RunnerTests/RunnerTests.swift b/brick/__brick__/{{project_name.snakeCase()}}/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/brick/__brick__/{{project_name.snakeCase()}}/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/brick/__brick__/{{project_name.snakeCase()}}/pubspec.yaml b/brick/__brick__/{{project_name.snakeCase()}}/pubspec.yaml index 8f3ccb2..157c3c6 100644 --- a/brick/__brick__/{{project_name.snakeCase()}}/pubspec.yaml +++ b/brick/__brick__/{{project_name.snakeCase()}}/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.1.0 <4.0.0" dependencies: audioplayers: ^5.0.0 @@ -23,12 +23,12 @@ dependencies: mockingjay: ^0.4.0 dev_dependencies: - bloc_test: ^9.1.2 - flame_test: ^1.10.1 + bloc_test: ^9.1.4 + flame_test: ^1.12.1 flutter_test: sdk: flutter mocktail: ^1.0.0 - very_good_analysis: ^5.0.0 + very_good_analysis: ^5.1.0 flutter: uses-material-design: true diff --git a/brick/__brick__/{{project_name.snakeCase()}}/test/game/components/counter_component_test.dart b/brick/__brick__/{{project_name.snakeCase()}}/test/game/components/counter_component_test.dart index e6c4a10..904d5b2 100644 --- a/brick/__brick__/{{project_name.snakeCase()}}/test/game/components/counter_component_test.dart +++ b/brick/__brick__/{{project_name.snakeCase()}}/test/game/components/counter_component_test.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'package:audioplayers/audioplayers.dart'; import 'package:flame/extensions.dart'; import 'package:flame_test/flame_test.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:{{project_name.snakeCase()}}/game/game.dart'; @@ -26,6 +27,18 @@ void main() { // https://github.com/material-foundation/flutter-packages/issues/286#issuecomment-1406343761 HttpOverrides.global = null; + setUpAll(() { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + const MethodChannel('plugins.flutter.io/path_provider'), + (message) async => switch (message.method) { + ('getTemporaryDirectory' || 'getApplicationSupportDirectory') => + Directory.systemTemp.createTempSync('fake').path, + _ => null, + }, + ); + }); + final l10n = _MockAppLocalizations(); _VeryGoodFlameGame createFlameGame() { return _VeryGoodFlameGame(l10n: l10n, effectPlayer: _MockAudioPlayer()); diff --git a/brick/__brick__/{{project_name.snakeCase()}}/test/game/view/game_page_test.dart b/brick/__brick__/{{project_name.snakeCase()}}/test/game/view/game_page_test.dart index 8fa39e2..f09a561 100644 --- a/brick/__brick__/{{project_name.snakeCase()}}/test/game/view/game_page_test.dart +++ b/brick/__brick__/{{project_name.snakeCase()}}/test/game/view/game_page_test.dart @@ -38,12 +38,11 @@ void main() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler( - MethodChannel('plugins.flutter.io/path_provider'), - (message) async { - if (message.method == 'getTemporaryDirectory') { - return Directory.systemTemp.path; - } - return null; + const MethodChannel('plugins.flutter.io/path_provider'), + (message) async => switch (message.method) { + ('getTemporaryDirectory' || 'getApplicationSupportDirectory') => + Directory.systemTemp.createTempSync('fake').path, + _ => null, }, ); });