File tree Expand file tree Collapse file tree 3 files changed +91
-17
lines changed Expand file tree Collapse file tree 3 files changed +91
-17
lines changed Original file line number Diff line number Diff line change 23
23
# Flutter/Dart/Pub related
24
24
** /doc /api /
25
25
** /ios /Flutter /.last_build_id
26
- .dart_tool /
27
- .flutter-plugins
28
- .flutter-plugins-dependencies
29
- .packages
30
- .pub-cache /
31
- .pub /
32
- /build /
26
+ example_app /.dart_tool /
27
+ example_app /.flutter-plugins
28
+ example_app /.flutter-plugins-dependencies
29
+ example_app /.packages
30
+ example_app /.pub-cache /
31
+ example_app /.pub /
32
+ example_app /build /
33
+ example_app /flutter /
33
34
34
35
# Web related
35
- lib /generated_plugin_registrant.dart
36
+ example_app / lib /generated_plugin_registrant.dart
36
37
37
38
# Symbolication related
38
- app. * .symbols
39
+ example_app / app. * .symbols
39
40
40
41
# Obfuscation related
41
- app. * .map.json
42
+ example_app / app. * .map.json
42
43
43
44
# Android Studio will place build artifacts here
44
- /android /app /debug
45
- /android /app /profile
46
- /android /app /release
45
+ example_app /android /app /debug
46
+ example_app /android /app /profile
47
+ example_app /android /app /release
48
+
49
+ # Local Netlify folder
50
+ .netlify
Original file line number Diff line number Diff line change 11
11
# Reminder to check for updates to the build script.
12
12
# Flutter for web is still in beta so expect updates!
13
13
14
- CURRENT_VERSION=1.0.1
14
+ CURRENT_VERSION=1.1.0
15
15
REMOTE_URL=" https://github.com/FrankFlitton/Flutter-for-web-deploy-script"
16
- REMOTE_TAGS=" $( git ls-remote --tags $REMOTE_URL ) "
16
+ REMOTE_TAGS=" $( echo $( git ls-remote --tags $REMOTE_URL ) ) "
17
17
18
18
REMOTE_HASHES=()
19
19
REMOTE_VERSIONS=()
@@ -98,4 +98,39 @@ $FLUTTER_BIN build web --release
98
98
echo " 🚚🖼 Copying graphic assets to their expected folders"
99
99
cp -R $APP_DIR /build/web/assets/. $APP_DIR /build/web/
100
100
101
+ # Start cache breaking
102
+
103
+ BUILD_HASH=$(( 1 + $RANDOM % 100000 ))
104
+ HASHED_FILE=" "
105
+
106
+ fileExtHash () {
107
+ SEPERATOR=$( echo $1 | tail -c 2)
108
+ F_EXT=$( echo $1 | cut -d" $SEPERATOR " -f 1)
109
+ HASHED_EXT=$F_EXT " ?" $BUILD_HASH$SEPERATOR
110
+ HASHED_FILE=$HASHED_EXT
111
+ }
112
+
113
+ replacePath () {
114
+ INPUT_FILE=$1
115
+ TARGET_EXT=$2
116
+ TARGET_HASHED_EXT=$3
117
+ cat $INPUT_FILE | awk -v srch=" $TARGET_EXT " -v repl=" $TARGET_HASHED_EXT " ' { sub(srch,repl,$0); print $0 }' > tmp && mv tmp $INPUT_FILE
118
+ }
119
+
120
+ # Force new js to be loaded by the browser.
121
+ # Breaking cache on js and json files in index.html
122
+
123
+ HTML_EXTS=(" js" " json" )
124
+
125
+ echo " ✅📦 Hashing assets for this release"
126
+
127
+ for EXT_ROOT in ${HTML_EXTS[@]} ; do
128
+ # echo $EXT
129
+ EXT_LIST=(" ." $EXT_ROOT \" " ." $EXT_ROOT \' )
130
+ for EXT in ${EXT_LIST[@]} ; do
131
+ fileExtHash $EXT
132
+ replacePath $APP_DIR /build/web/index.html $EXT $HASHED_FILE
133
+ done
134
+ done
135
+
101
136
echo " ✅🦋 Flutter for web build pipeline complete!"
Original file line number Diff line number Diff line change 11
11
# Reminder to check for updates to the build script.
12
12
# Flutter for web is still in beta so expect updates!
13
13
14
- CURRENT_VERSION=1.0.1
14
+ CURRENT_VERSION=1.1.0
15
15
REMOTE_URL=" https://github.com/FrankFlitton/Flutter-for-web-deploy-script"
16
- REMOTE_TAGS=" $( git ls-remote --tags $REMOTE_URL ) "
16
+ REMOTE_TAGS=" $( echo $( git ls-remote --tags $REMOTE_URL ) ) "
17
17
18
18
REMOTE_HASHES=()
19
19
REMOTE_VERSIONS=()
@@ -98,4 +98,39 @@ $FLUTTER_BIN build web --release
98
98
echo " 🚚🖼 Copying graphic assets to their expected folders"
99
99
cp -R $APP_DIR /build/web/assets/. $APP_DIR /build/web/
100
100
101
+ # Start cache breaking
102
+
103
+ BUILD_HASH=$(( 1 + $RANDOM % 100000 ))
104
+ HASHED_FILE=" "
105
+
106
+ fileExtHash () {
107
+ SEPERATOR=$( echo $1 | tail -c 2)
108
+ F_EXT=$( echo $1 | cut -d" $SEPERATOR " -f 1)
109
+ HASHED_EXT=$F_EXT " ?" $BUILD_HASH$SEPERATOR
110
+ HASHED_FILE=$HASHED_EXT
111
+ }
112
+
113
+ replacePath () {
114
+ INPUT_FILE=$1
115
+ TARGET_EXT=$2
116
+ TARGET_HASHED_EXT=$3
117
+ cat $INPUT_FILE | awk -v srch=" $TARGET_EXT " -v repl=" $TARGET_HASHED_EXT " ' { sub(srch,repl,$0); print $0 }' > tmp && mv tmp $INPUT_FILE
118
+ }
119
+
120
+ # Force new js to be loaded by the browser.
121
+ # Breaking cache on js and json files in index.html
122
+
123
+ HTML_EXTS=(" js" " json" )
124
+
125
+ echo " ✅📦 Hashing assets for this release"
126
+
127
+ for EXT_ROOT in ${HTML_EXTS[@]} ; do
128
+ # echo $EXT
129
+ EXT_LIST=(" ." $EXT_ROOT \" " ." $EXT_ROOT \' )
130
+ for EXT in ${EXT_LIST[@]} ; do
131
+ fileExtHash $EXT
132
+ replacePath $APP_DIR /build/web/index.html $EXT $HASHED_FILE
133
+ done
134
+ done
135
+
101
136
echo " ✅🦋 Flutter for web build pipeline complete!"
You can’t perform that action at this time.
0 commit comments