rename prod-build to jsbundle so it means something
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
9d1bf5714d
commit
2acd5b4cb0
49
Makefile
49
Makefile
|
@ -105,46 +105,55 @@ release-ios: export BUILD_ENV ?= prod
|
||||||
release-ios: watchman-clean ##@build build release for iOS release
|
release-ios: watchman-clean ##@build build release for iOS release
|
||||||
# Open XCode inside the Nix context
|
# Open XCode inside the Nix context
|
||||||
@git clean -dxf -f target/ios && \
|
@git clean -dxf -f target/ios && \
|
||||||
$(MAKE) prod-build-ios && \
|
$(MAKE) jsbundle-ios && \
|
||||||
echo "Build in XCode, see https://status.im/build_status/ for instructions" && \
|
echo "Build in XCode, see https://status.im/build_status/ for instructions" && \
|
||||||
scripts/copy-translations.sh && \
|
scripts/copy-translations.sh && \
|
||||||
open ios/StatusIm.xcworkspace
|
open ios/StatusIm.xcworkspace
|
||||||
|
|
||||||
release-desktop: export TARGET_OS ?= $(HOST_OS)
|
release-desktop: export TARGET_OS ?= $(HOST_OS)
|
||||||
release-desktop: ##@build build release for desktop release
|
release-desktop: ##@build build release for desktop release based on TARGET_OS
|
||||||
@$(MAKE) prod-build-desktop && \
|
@$(MAKE) jsbundle-desktop && \
|
||||||
scripts/copy-translations.sh && \
|
scripts/copy-translations.sh && \
|
||||||
scripts/build-desktop.sh; \
|
scripts/build-desktop.sh; \
|
||||||
$(MAKE) watchman-clean
|
$(MAKE) watchman-clean
|
||||||
|
|
||||||
release-windows-desktop: export TARGET_OS ?= windows
|
release-windows-desktop: export TARGET_OS ?= windows
|
||||||
release-windows-desktop: ##@build build release for desktop release
|
release-windows-desktop: ##@build build release for windows desktop release
|
||||||
@$(MAKE) prod-build-desktop && \
|
@$(MAKE) jsbundle-desktop && \
|
||||||
scripts/copy-translations.sh && \
|
scripts/copy-translations.sh && \
|
||||||
scripts/build-desktop.sh; \
|
scripts/build-desktop.sh; \
|
||||||
$(MAKE) watchman-clean
|
$(MAKE) watchman-clean
|
||||||
|
|
||||||
prod-build-android: SHELL := /bin/sh
|
prod-build-android: jsbundle-android ##@legacy temporary legacy alias for jsbundle-android
|
||||||
prod-build-android: export TARGET_OS ?= android
|
@echo "${YELLOW}This a deprecated target name, use jsbundle-android.$(RESET)"
|
||||||
prod-build-android: export BUILD_ENV ?= prod
|
|
||||||
prod-build-android:
|
jsbundle-android: SHELL := /bin/sh
|
||||||
# Call nix-build to build the 'targets.mobile.prod-build' attribute and copy the index.android.js file to the project root
|
jsbundle-android: export TARGET_OS ?= android
|
||||||
|
jsbundle-android: export BUILD_ENV ?= prod
|
||||||
|
jsbundle-android: ##@jsbundle Compile JavaScript and Clojure into index.android.js
|
||||||
|
# Call nix-build to build the 'targets.mobile.jsbundle' attribute and copy the index.android.js file to the project root
|
||||||
@git clean -dxf -f ./index.$(TARGET_OS).js && \
|
@git clean -dxf -f ./index.$(TARGET_OS).js && \
|
||||||
_NIX_RESULT_PATH=$(shell . ~/.nix-profile/etc/profile.d/nix.sh && nix-build --argstr target-os $(TARGET_OS) --pure --no-out-link --show-trace -A targets.mobile.prod-build) && \
|
_NIX_RESULT_PATH=$(shell . ~/.nix-profile/etc/profile.d/nix.sh && nix-build --argstr target-os $(TARGET_OS) --pure --no-out-link --show-trace -A targets.mobile.jsbundle) && \
|
||||||
[ -n "$${_NIX_RESULT_PATH}" ] && cp -av $${_NIX_RESULT_PATH}/* .
|
[ -n "$${_NIX_RESULT_PATH}" ] && cp -av $${_NIX_RESULT_PATH}/* .
|
||||||
|
|
||||||
prod-build-ios: export TARGET_OS ?= ios
|
prod-build-ios: jsbundle-ios ##@legacy temporary legacy alias for jsbundle-ios
|
||||||
prod-build-ios: export BUILD_ENV ?= prod
|
@echo "${YELLOW}This a deprecated target name, use jsbundle-ios.$(RESET)"
|
||||||
prod-build-ios:
|
|
||||||
|
jsbundle-ios: export TARGET_OS ?= ios
|
||||||
|
jsbundle-ios: export BUILD_ENV ?= prod
|
||||||
|
jsbundle-ios: ##@jsbundle Compile JavaScript and Clojure into index.ios.js
|
||||||
@git clean -dxf -f ./index.$(TARGET_OS).js && \
|
@git clean -dxf -f ./index.$(TARGET_OS).js && \
|
||||||
lein prod-build-ios && \
|
lein jsbundle-ios && \
|
||||||
node prepare-modules.js
|
node prepare-modules.js
|
||||||
|
|
||||||
prod-build-desktop: export TARGET_OS ?= $(HOST_OS)
|
prod-build-desktop: jsbundle-desktop ##@legacy temporary legacy alias for jsbundle-desktop
|
||||||
prod-build-desktop: export BUILD_ENV ?= prod
|
@echo "${YELLOW}This a deprecated target name, use jsbundle-desktop.$(RESET)"
|
||||||
prod-build-desktop:
|
|
||||||
|
jsbundle-desktop: export TARGET_OS ?= $(HOST_OS)
|
||||||
|
jsbundle-desktop: export BUILD_ENV ?= prod
|
||||||
|
jsbundle-desktop: ##@jsbundle Compile JavaScript and Clojure into index.desktop.js
|
||||||
git clean -qdxf -f ./index.desktop.js desktop/ && \
|
git clean -qdxf -f ./index.desktop.js desktop/ && \
|
||||||
lein prod-build-desktop && \
|
lein jsbundle-desktop && \
|
||||||
node prepare-modules.js
|
node prepare-modules.js
|
||||||
|
|
||||||
#--------------
|
#--------------
|
||||||
|
@ -249,7 +258,7 @@ android-ports: ##@other Add proxies to Android Device/Simulator
|
||||||
|
|
||||||
android-logcat: export _NIX_ATTR := targets.mobile.android.adb.shell
|
android-logcat: export _NIX_ATTR := targets.mobile.android.adb.shell
|
||||||
android-logcat: export TARGET_OS ?= android
|
android-logcat: export TARGET_OS ?= android
|
||||||
android-logcat:
|
android-logcat: ##@other Read status-react logs from Android phone using adb
|
||||||
adb logcat | grep -e StatusModule -e ReactNativeJS -e StatusNativeLogs
|
adb logcat | grep -e StatusModule -e ReactNativeJS -e StatusNativeLogs
|
||||||
|
|
||||||
android-install: export _NIX_ATTR := targets.mobile.android.adb.shell
|
android-install: export _NIX_ATTR := targets.mobile.android.adb.shell
|
||||||
|
|
|
@ -81,9 +81,9 @@ pipeline {
|
||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
stage('Build') { stages {
|
stage('Build') { stages {
|
||||||
stage('Clojure') {
|
stage('JSBundle') {
|
||||||
steps {
|
steps {
|
||||||
script { cmn.nix.build(attr: "targets.mobile.prod-build") }
|
script { cmn.nix.build(attr: 'targets.mobile.jsbundle') }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Bundle') {
|
stage('Bundle') {
|
||||||
|
|
|
@ -64,9 +64,9 @@ pipeline {
|
||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
stage('Build') { stages {
|
stage('Build') { stages {
|
||||||
stage('Clojure') {
|
stage('JSBundle') {
|
||||||
steps {
|
steps {
|
||||||
script { cmn.nix.shell('make prod-build-ios') }
|
script { cmn.nix.shell('make jsbundle-ios') }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Bundle') {
|
stage('Bundle') {
|
||||||
|
|
|
@ -68,9 +68,9 @@ pipeline {
|
||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
stage('Build') { stages {
|
stage('Build') { stages {
|
||||||
stage('Clojure') {
|
stage('JSBundle') {
|
||||||
steps {
|
steps {
|
||||||
script { desktop.buildClojureScript() }
|
script { desktop.buildJSBundle() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Compile') {
|
stage('Compile') {
|
||||||
|
|
|
@ -64,9 +64,9 @@ pipeline {
|
||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
stage('Build') { stages {
|
stage('Build') { stages {
|
||||||
stage('Clojure') {
|
stage('JSBundle') {
|
||||||
steps {
|
steps {
|
||||||
script { desktop.buildClojureScript() }
|
script { desktop.buildJSBundle() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Compile') {
|
stage('Compile') {
|
||||||
|
|
|
@ -42,11 +42,11 @@ pipeline {
|
||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
}
|
}
|
||||||
stage('Build prod-build-android') {
|
stage('Build jsbundle-android') {
|
||||||
steps {
|
steps {
|
||||||
// Run a Nix build to build/fetch everything that is necessary to produce a prod-build for TARGET_OS=android (e.g. maven and node repos)
|
// Run a Nix build to build/fetch everything that is necessary to produce a jsbundle for TARGET_OS=android (e.g. maven and node repos)
|
||||||
sh '''
|
sh '''
|
||||||
args="--argstr target-os android --show-trace -A targets.mobile.prod-build"
|
args="--argstr target-os android --show-trace -A targets.mobile.jsbundle"
|
||||||
|
|
||||||
. ~/.nix-profile/etc/profile.d/nix.sh && \
|
. ~/.nix-profile/etc/profile.d/nix.sh && \
|
||||||
nix-build --pure --no-out-link $args
|
nix-build --pure --no-out-link $args
|
||||||
|
@ -74,9 +74,9 @@ pipeline {
|
||||||
. ~/.nix-profile/etc/profile.d/nix.sh && \
|
. ~/.nix-profile/etc/profile.d/nix.sh && \
|
||||||
find /nix/store/ -mindepth 1 -maxdepth 1 \
|
find /nix/store/ -mindepth 1 -maxdepth 1 \
|
||||||
-not -name '.links' -and -not -name '*.lock' \
|
-not -name '.links' -and -not -name '*.lock' \
|
||||||
-and -not -name '*-status-react-prod-build-source' \
|
-and -not -name '*-status-react-jsbundle-source' \
|
||||||
-and -not -name '*-status-react-release-android-source' \
|
-and -not -name '*-status-react-release-android-source' \
|
||||||
-and -not -name '*-prod-build-*' \
|
-and -not -name '*-jsbundle-*' \
|
||||||
-and -not -name '*-release-android' | \
|
-and -not -name '*-release-android' | \
|
||||||
xargs nix-copy-closure -v --to ${NIX_CACHE_USER}@${NIX_CACHE_HOST}
|
xargs nix-copy-closure -v --to ${NIX_CACHE_USER}@${NIX_CACHE_HOST}
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -71,9 +71,9 @@ pipeline {
|
||||||
}
|
}
|
||||||
} }
|
} }
|
||||||
stage('Build') { stages {
|
stage('Build') { stages {
|
||||||
stage('Clojure') {
|
stage('JSBundle') {
|
||||||
steps {
|
steps {
|
||||||
script { desktop.buildClojureScript() }
|
script { desktop.buildJSBundle() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Compile') {
|
stage('Compile') {
|
||||||
|
|
|
@ -3,11 +3,11 @@ utils = load 'ci/utils.groovy'
|
||||||
|
|
||||||
packageFolder = './StatusImPackage'
|
packageFolder = './StatusImPackage'
|
||||||
|
|
||||||
def buildClojureScript() {
|
def buildJSBundle() {
|
||||||
nix.shell(
|
nix.shell(
|
||||||
'''
|
'''
|
||||||
make prod-build-desktop && \
|
make jsbundle-desktop && \
|
||||||
./scripts/build-desktop.sh buildClojureScript
|
./scripts/build-desktop.sh buildJSBundle
|
||||||
''',
|
''',
|
||||||
keep: ['VERBOSE_LEVEL']
|
keep: ['VERBOSE_LEVEL']
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,13 +18,11 @@ let
|
||||||
go = pkgs.callPackage ./patched-go { inherit baseGo; };
|
go = pkgs.callPackage ./patched-go { inherit baseGo; };
|
||||||
buildGoPackage = pkgs.buildGoPackage.override { inherit go; };
|
buildGoPackage = pkgs.buildGoPackage.override { inherit go; };
|
||||||
desktop = pkgs.callPackage ./desktop { inherit target-os stdenv status-go pkgs go nodejs; inherit (pkgs) darwin; };
|
desktop = pkgs.callPackage ./desktop { inherit target-os stdenv status-go pkgs go nodejs; inherit (pkgs) darwin; };
|
||||||
mobile = pkgs.callPackage ./mobile { inherit target-os config stdenv pkgs mkShell nodejs yarn status-go maven localMavenRepoBuilder mkFilter prod-build-fn; inherit (pkgs.xcodeenv) composeXcodeWrapper; };
|
mobile = pkgs.callPackage ./mobile { inherit target-os config stdenv pkgs mkShell nodejs yarn status-go maven localMavenRepoBuilder mkFilter; inherit (pkgs.xcodeenv) composeXcodeWrapper; };
|
||||||
status-go = pkgs.callPackage ./status-go { inherit target-os go buildGoPackage; inherit (mobile.ios) xcodeWrapper; androidPkgs = mobile.android.androidComposition; };
|
status-go = pkgs.callPackage ./status-go { inherit target-os go buildGoPackage; inherit (mobile.ios) xcodeWrapper; androidPkgs = mobile.android.androidComposition; };
|
||||||
# mkFilter is a function that allows filtering a directory structure (used for filtering source files being captured in a closure)
|
# mkFilter is a function that allows filtering a directory structure (used for filtering source files being captured in a closure)
|
||||||
mkFilter = import ./tools/mkFilter.nix { inherit (stdenv) lib; };
|
mkFilter = import ./tools/mkFilter.nix { inherit (stdenv) lib; };
|
||||||
localMavenRepoBuilder = pkgs.callPackage ./tools/maven/maven-repo-builder.nix { inherit (pkgs) stdenv; };
|
localMavenRepoBuilder = pkgs.callPackage ./tools/maven/maven-repo-builder.nix { inherit (pkgs) stdenv; };
|
||||||
# Import a function that can build a prod-build target with specified node dependencies Nix expression
|
|
||||||
prod-build-fn = pkgs.callPackage ./targets/prod-build.nix { inherit stdenv pkgs target-os nodejs localMavenRepoBuilder mkFilter; };
|
|
||||||
nodejs = pkgs.nodejs-10_x;
|
nodejs = pkgs.nodejs-10_x;
|
||||||
yarn = pkgs.yarn.override { inherit nodejs; };
|
yarn = pkgs.yarn.override { inherit nodejs; };
|
||||||
selectedSources =
|
selectedSources =
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ config, stdenv, stdenvNoCC, target-os, callPackage, mkShell,
|
{ config, stdenv, stdenvNoCC, target-os, callPackage, mkShell,
|
||||||
mkFilter, androidenv, fetchurl, openjdk, nodejs, bash, maven, zlib,
|
mkFilter, androidenv, fetchurl, openjdk, nodejs, bash, maven, zlib,
|
||||||
status-go, localMavenRepoBuilder, projectNodePackage, prod-build-fn }:
|
status-go, localMavenRepoBuilder, projectNodePackage, jsbundle }:
|
||||||
|
|
||||||
let
|
let
|
||||||
platform = callPackage ../../platform.nix { inherit target-os; };
|
platform = callPackage ../../platform.nix { inherit target-os; };
|
||||||
|
@ -12,8 +12,7 @@ let
|
||||||
mavenAndNpmDeps = callPackage ./maven-and-npm-deps { inherit stdenv stdenvNoCC gradle bash nodejs zlib localMavenRepoBuilder mkFilter projectNodePackage status-go; androidEnvShellHook = androidEnv.shellHook; };
|
mavenAndNpmDeps = callPackage ./maven-and-npm-deps { inherit stdenv stdenvNoCC gradle bash nodejs zlib localMavenRepoBuilder mkFilter projectNodePackage status-go; androidEnvShellHook = androidEnv.shellHook; };
|
||||||
|
|
||||||
# TARGETS
|
# TARGETS
|
||||||
prod-build = (prod-build-fn { inherit projectNodePackage; });
|
release = callPackage ./targets/release-android.nix { inherit target-os gradle mavenAndNpmDeps mkFilter nodejs jsbundle status-go zlib; androidEnvShellHook = androidEnv.shellHook; };
|
||||||
release = callPackage ./targets/release-android.nix { inherit target-os gradle mavenAndNpmDeps mkFilter nodejs prod-build status-go zlib; androidEnvShellHook = androidEnv.shellHook; };
|
|
||||||
generate-maven-and-npm-deps-shell = callPackage ./maven-and-npm-deps/maven/shell.nix { inherit gradle maven projectNodePackage status-go; androidEnvShellHook = androidEnv.shellHook; };
|
generate-maven-and-npm-deps-shell = callPackage ./maven-and-npm-deps/maven/shell.nix { inherit gradle maven projectNodePackage status-go; androidEnvShellHook = androidEnv.shellHook; };
|
||||||
adb-shell = mkShell {
|
adb-shell = mkShell {
|
||||||
buildInputs = [ androidEnv.licensedAndroidEnv ];
|
buildInputs = [ androidEnv.licensedAndroidEnv ];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, stdenvNoCC, lib, target-os, callPackage,
|
{ stdenv, stdenvNoCC, lib, target-os, callPackage,
|
||||||
mkFilter, bash, file, gnumake, watchman, gradle, androidEnvShellHook, mavenAndNpmDeps, nodejs, openjdk, prod-build, status-go, zlib }:
|
mkFilter, bash, file, gnumake, watchman, gradle, androidEnvShellHook, mavenAndNpmDeps, nodejs, openjdk, jsbundle, status-go, zlib }:
|
||||||
|
|
||||||
{ build-number ? "9999",
|
{ build-number ? "9999",
|
||||||
build-type ? "nightly", # Build type (e.g. nightly, release, e2e). Default is to use .env.nightly file
|
build-type ? "nightly", # Build type (e.g. nightly, release, e2e). Default is to use .env.nightly file
|
||||||
|
@ -54,7 +54,7 @@ in stdenv.mkDerivation {
|
||||||
cp -f $sourceRoot/${envFileName} $sourceRoot/.env
|
cp -f $sourceRoot/${envFileName} $sourceRoot/.env
|
||||||
|
|
||||||
# Copy index.*.js input file
|
# Copy index.*.js input file
|
||||||
cp -a --no-preserve=ownership ${prod-build}/index*.js $sourceRoot/
|
cp -a --no-preserve=ownership ${jsbundle}/index*.js $sourceRoot/
|
||||||
|
|
||||||
# Copy android/ directory
|
# Copy android/ directory
|
||||||
cp -a --no-preserve=ownership ${sourceProjectDir}/android/ $sourceRoot/
|
cp -a --no-preserve=ownership ${sourceProjectDir}/android/ $sourceRoot/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ config, stdenv, pkgs, callPackage, mkShell, fetchurl, fetchFromGitHub, target-os,
|
{ config, stdenv, pkgs, callPackage, mkShell, fetchurl, fetchFromGitHub, target-os,
|
||||||
mkFilter, localMavenRepoBuilder, maven, status-go, composeXcodeWrapper, nodejs, yarn, prod-build-fn }:
|
mkFilter, localMavenRepoBuilder, maven, status-go, composeXcodeWrapper, nodejs, yarn }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (stdenv.lib) catAttrs concatStrings optional unique;
|
inherit (stdenv.lib) catAttrs concatStrings optional unique;
|
||||||
|
@ -9,7 +9,7 @@ let
|
||||||
version = "10.2.1";
|
version = "10.2.1";
|
||||||
};
|
};
|
||||||
xcodeWrapper = composeXcodeWrapper xcodewrapperArgs;
|
xcodeWrapper = composeXcodeWrapper xcodewrapperArgs;
|
||||||
androidPlatform = callPackage ./android { inherit config target-os mkShell mkFilter nodejs maven localMavenRepoBuilder projectNodePackage prod-build-fn; status-go = status-go.android; };
|
androidPlatform = callPackage ./android { inherit config target-os mkShell mkFilter nodejs maven localMavenRepoBuilder projectNodePackage jsbundle; status-go = status-go.android; };
|
||||||
iosPlatform = callPackage ./ios { inherit config mkFilter mkShell xcodeWrapper projectNodePackage; status-go = status-go.ios; };
|
iosPlatform = callPackage ./ios { inherit config mkFilter mkShell xcodeWrapper projectNodePackage; status-go = status-go.ios; };
|
||||||
fastlane = callPackage ./fastlane { inherit stdenv target-os mkShell; };
|
fastlane = callPackage ./fastlane { inherit stdenv target-os mkShell; };
|
||||||
selectedSources = [
|
selectedSources = [
|
||||||
|
@ -23,7 +23,7 @@ let
|
||||||
projectNodePackage = callPackage ./node-package.nix { inherit pkgs nodejs yarn; };
|
projectNodePackage = callPackage ./node-package.nix { inherit pkgs nodejs yarn; };
|
||||||
|
|
||||||
# TARGETS
|
# TARGETS
|
||||||
prod-build = prod-build-fn { inherit projectNodePackage; };
|
jsbundle = pkgs.callPackage ../targets/jsbundle.nix { inherit stdenv pkgs target-os nodejs localMavenRepoBuilder mkFilter projectNodePackage; };
|
||||||
|
|
||||||
in {
|
in {
|
||||||
buildInputs = unique (catAttrs "buildInputs" selectedSources);
|
buildInputs = unique (catAttrs "buildInputs" selectedSources);
|
||||||
|
@ -34,5 +34,5 @@ in {
|
||||||
ios = iosPlatform;
|
ios = iosPlatform;
|
||||||
|
|
||||||
# TARGETS
|
# TARGETS
|
||||||
inherit prod-build fastlane;
|
inherit jsbundle fastlane;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,23 +3,20 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
{ stdenv, stdenvNoCC, lib, target-os, callPackage, pkgs,
|
{ stdenv, stdenvNoCC, lib, target-os, callPackage, pkgs,
|
||||||
mkFilter, clojure, leiningen, maven, nodejs, localMavenRepoBuilder }:
|
mkFilter, clojure, leiningen, maven, nodejs, localMavenRepoBuilder, projectNodePackage }:
|
||||||
|
|
||||||
# The Nix expression takes a second argument to specify the node dependencies
|
|
||||||
{ projectNodePackage }:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
lein-command = if target-os == "all" then "lein prod-build" else "lein prod-build-${target-os}";
|
lein-command = if target-os == "all" then "lein jsbundle" else "lein jsbundle-${target-os}";
|
||||||
lein-project-deps = import ../lein/lein-project-deps.nix { };
|
lein-project-deps = import ../lein/lein-project-deps.nix { };
|
||||||
leinProjectDepsLocalRepo = localMavenRepoBuilder "lein-project-deps" lein-project-deps;
|
leinProjectDepsLocalRepo = localMavenRepoBuilder "lein-project-deps" lein-project-deps;
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "prod-build-${target-os}";
|
name = "jsbundle-${target-os}";
|
||||||
src =
|
src =
|
||||||
let path = ./../..;
|
let path = ./../..;
|
||||||
in builtins.path { # We use builtins.path so that we can name the resulting derivation, otherwise the name would be taken from the checkout directory, which is outside of our control
|
in builtins.path { # We use builtins.path so that we can name the resulting derivation, otherwise the name would be taken from the checkout directory, which is outside of our control
|
||||||
inherit path;
|
inherit path;
|
||||||
name = "status-react-prod-build-source";
|
name = "status-react-jsbundle-source";
|
||||||
filter =
|
filter =
|
||||||
# Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size
|
# Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size
|
||||||
mkFilter {
|
mkFilter {
|
|
@ -30,18 +30,18 @@
|
||||||
:pre-commit ["lein cljfmt check src/status_im/core.cljs $(git diff --diff-filter=d --cached --name-only src test/cljs)"]}
|
:pre-commit ["lein cljfmt check src/status_im/core.cljs $(git diff --diff-filter=d --cached --name-only src test/cljs)"]}
|
||||||
:cljfmt {:indents {letsubs [[:inner 0]]}}
|
:cljfmt {:indents {letsubs [[:inner 0]]}}
|
||||||
:clean-targets ["target/" "index.ios.js" "index.android.js" "status-modules/cljs"]
|
:clean-targets ["target/" "index.ios.js" "index.android.js" "status-modules/cljs"]
|
||||||
:aliases {"prod-build" ^{:doc "Recompile code with prod profile."}
|
:aliases {"jsbundle" ^{:doc "Recompile code with prod profile."}
|
||||||
["do" "clean"
|
["do" "clean"
|
||||||
["with-profile" "prod" "cljsbuild" "once" "ios"]
|
["with-profile" "prod" "cljsbuild" "once" "ios"]
|
||||||
["with-profile" "prod" "cljsbuild" "once" "android"]
|
["with-profile" "prod" "cljsbuild" "once" "android"]
|
||||||
["with-profile" "prod" "cljsbuild" "once" "desktop"]]
|
["with-profile" "prod" "cljsbuild" "once" "desktop"]]
|
||||||
"prod-build-android" ^{:doc "Recompile code for Android with prod profile."}
|
"jsbundle-android" ^{:doc "Recompile code for Android with prod profile."}
|
||||||
["do" "clean"
|
["do" "clean"
|
||||||
["with-profile" "prod" "cljsbuild" "once" "android"]]
|
["with-profile" "prod" "cljsbuild" "once" "android"]]
|
||||||
"prod-build-ios" ^{:doc "Recompile code for iOS with prod profile."}
|
"jsbundle-ios" ^{:doc "Recompile code for iOS with prod profile."}
|
||||||
["do" "clean"
|
["do" "clean"
|
||||||
["with-profile" "prod" "cljsbuild" "once" "ios"]]
|
["with-profile" "prod" "cljsbuild" "once" "ios"]]
|
||||||
"prod-build-desktop" ^{:doc "Recompile code for desktop with prod profile."}
|
"jsbundle-desktop" ^{:doc "Recompile code for desktop with prod profile."}
|
||||||
["do" "clean"
|
["do" "clean"
|
||||||
["with-profile" "prod" "cljsbuild" "once" "desktop"]]
|
["with-profile" "prod" "cljsbuild" "once" "desktop"]]
|
||||||
"figwheel-repl" ["with-profile" "+figwheel" "run" "-m" "clojure.main" "env/dev/run.clj"]
|
"figwheel-repl" ["with-profile" "+figwheel" "run" "-m" "clojure.main" "env/dev/run.clj"]
|
||||||
|
|
|
@ -128,7 +128,7 @@ function joinStrings() {
|
||||||
echo ${var[@]}
|
echo ${var[@]}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildClojureScript() {
|
function buildJSBundle() {
|
||||||
# create directory for all work related to bundling
|
# create directory for all work related to bundling
|
||||||
rm -rf $WORKFOLDER
|
rm -rf $WORKFOLDER
|
||||||
mkdir -p $WORKFOLDER
|
mkdir -p $WORKFOLDER
|
||||||
|
@ -490,7 +490,7 @@ function bundle() {
|
||||||
init
|
init
|
||||||
|
|
||||||
if [ -z "$@" ]; then
|
if [ -z "$@" ]; then
|
||||||
buildClojureScript
|
buildJSBundle
|
||||||
compile
|
compile
|
||||||
bundle
|
bundle
|
||||||
else
|
else
|
||||||
|
|
|
@ -22,7 +22,7 @@ function cleanup() {
|
||||||
local releaseSrcPath=$(nix-store -q --binding src $releaseDrv)
|
local releaseSrcPath=$(nix-store -q --binding src $releaseDrv)
|
||||||
local releaseOutPath=$(nix-store -q --outputs $releaseDrv)
|
local releaseOutPath=$(nix-store -q --outputs $releaseDrv)
|
||||||
local releaseRefs=( $(nix-store -q --references $releaseDrv) )
|
local releaseRefs=( $(nix-store -q --references $releaseDrv) )
|
||||||
local prodBuildDrv=$(printf -- '%s\n' "${releaseRefs[@]}" | grep -e "prod-build-android.drv")
|
local prodBuildDrv=$(printf -- '%s\n' "${releaseRefs[@]}" | grep -e "jsbundle-android.drv")
|
||||||
local prodBuildSrcPath=$(nix-store -q --binding src $prodBuildDrv)
|
local prodBuildSrcPath=$(nix-store -q --binding src $prodBuildDrv)
|
||||||
local prodBuildOutPath=$(nix-store -q --outputs $prodBuildDrv)
|
local prodBuildOutPath=$(nix-store -q --outputs $prodBuildDrv)
|
||||||
nix-store --delete $prodBuildDrv $prodBuildSrcPath $prodBuildOutPath $releaseDrv $releaseSrcPath $releaseOutPath 2> /dev/null
|
nix-store --delete $prodBuildDrv $prodBuildSrcPath $prodBuildOutPath $releaseDrv $releaseSrcPath $releaseOutPath 2> /dev/null
|
||||||
|
|
Loading…
Reference in New Issue