Skip to content

Commit

Permalink
project: fix packaging, v0.7.0 release was borked
Browse files Browse the repository at this point in the history
Unfortunately our QA department didn't catch that chrome webstore
removes all dot folders from uploaded zips when converting them to crx.

Also options javascript file url was broken.
  • Loading branch information
darwin committed Oct 10, 2016
1 parent 6589ff5 commit ddd24d7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ pom.xml*
/out/
.notify/
.figwheel*
resources/release/background.js
resources/release/options.js
2 changes: 1 addition & 1 deletion resources/release/background.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script type="text/javascript" src=".compiled/background.js"></script>
<script type="text/javascript" src="background.js"></script>
2 changes: 1 addition & 1 deletion resources/release/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/options.css">
<script type="text/javascript" src="_compiled/options.js"></script>
<script type="text/javascript" src="options.js"></script>
</head>
<body style="overflow:hidden">
<div id="options-form"></div>
Expand Down
3 changes: 2 additions & 1 deletion scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ DEVSERVER_ROOT="$DEVTOOLS_ROOT"
DEVSERVER_PORT=9000
RELEASES="$ROOT/releases"
RELEASE_BUILD="$ROOT/resources/release"
RELEASE_BUILD_COMPILED="$RELEASE_BUILD/.compiled"
RELEASE_BUILD_COMPILED_BACKGROUND_JS="$RELEASE_BUILD/background.js"
RELEASE_BUILD_COMPILED_OPTIONS_JS="$RELEASE_BUILD/options.js"
RELEASE_BUILD_DEVTOOLS="$RELEASE_BUILD/devtools"
RELEASE_BUILD_DEVTOOLS_FRONTEND="$RELEASE_BUILD_DEVTOOLS/front_end"
CSS_PROPERTIES_SOURCE="$CHROMIUM_MIRROR_DEVTOOLS_DIR/../core/css/CSSProperties.in"
Expand Down
16 changes: 14 additions & 2 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ if [ ! -d "$RELEASE_BUILD" ] ; then
exit 1
fi

if [ ! -d "$RELEASE_BUILD_COMPILED" ] ; then
echo "'$RELEASE_BUILD_COMPILED' does not exist, run 'lein release' to fully build the project"
if [ ! -f "$RELEASE_BUILD_COMPILED_BACKGROUND_JS" ] ; then
echo "'$RELEASE_BUILD_COMPILED_BACKGROUND_JS' does not exist, run 'lein release' to fully build the project"
popd
exit 2
fi

if [ ! -f "$RELEASE_BUILD_COMPILED_OPTIONS_JS" ] ; then
echo "'$RELEASE_BUILD_COMPILED_OPTIONS_JS' does not exist, run 'lein release' to fully build the project"
popd
exit 3
fi

if [ ! -d "$RELEASES" ] ; then
mkdir -p "$RELEASES"
fi
Expand All @@ -52,8 +58,14 @@ cp -r "$RELEASE_BUILD" "$PACKAGE_DIR" # this will copy actual files, not symlink

pushd "$PACKAGE_DIR"

if [ -f "$ZIP_NAME" ] ; then
rm "$ZIP_NAME"
fi

zip -qr -9 -X "$ZIP_NAME" .

unzip -l "$ZIP_NAME"

echo "'$ZIP_NAME' ready for upload => https://chrome.google.com/webstore/developer/dashboard"

popd
Expand Down
16 changes: 6 additions & 10 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ if [ -z "$RELEASE_BUILD_DEVTOOLS" ] ; then
exit 111
fi

if [ -z "$RELEASE_BUILD_COMPILED" ] ; then
echo "invalid config: RELEASE_BUILD_COMPILED env var is empty"
exit 112
if [ -f "$RELEASE_BUILD_COMPILED_BACKGROUND_JS" ] ; then
rm "$RELEASE_BUILD_COMPILED_BACKGROUND_JS"
fi

if [ -d "$RELEASE_BUILD_COMPILED" ] ; then
rm -rf "$RELEASE_BUILD_COMPILED"
if [ -f "$RELEASE_BUILD_COMPILED_OPTIONS_JS" ] ; then
rm "$RELEASE_BUILD_COMPILED_OPTIONS_JS"
fi
if [ -d "$RELEASE_BUILD_DEVTOOLS" ] ; then
rm -rf "$RELEASE_BUILD_DEVTOOLS"
Expand Down Expand Up @@ -105,15 +103,13 @@ cp -r "$FRONTEND/emulated_devices" "$RELEASE_BUILD_DEVTOOLS_FRONTEND"
cp "$FRONTEND/devtools.js" "$RELEASE_BUILD_DEVTOOLS_FRONTEND"

# copy compiled extension code (produced by `lein compile-dirac`)
cp -r "$ROOT/target/resources/release/.compiled" "$RELEASE_BUILD"
cp "$ROOT/target/resources/release/.compiled/background.js" "$RELEASE_BUILD/background.js"
cp "$ROOT/target/resources/release/.compiled/options.js" "$RELEASE_BUILD/options.js"

# ad-hoc cleanup
rm -rf "$RELEASE_BUILD_DEVTOOLS_FRONTEND/dirac"
rm -rf "$RELEASE_BUILD_DEVTOOLS_FRONTEND/Images/src"

rm -rf "$RELEASE_BUILD/.compiled/background"
rm -rf "$RELEASE_BUILD/.compiled/options"

popd

popd

0 comments on commit ddd24d7

Please sign in to comment.