Fix conflicts

This commit is contained in:
Quentin Guidée
2020-02-26 22:17:57 +01:00
19 changed files with 190 additions and 113 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/output/
/build/artifacts/
build/device/**/*.pyc
epsilon.elf
.vscode

View File

@@ -126,8 +126,7 @@ include build/struct_layout/Makefile
include build/scenario/Makefile
include quiz/Makefile # Quiz needs to be included at the end
all_src = $(apps_all_src) $(escher_src) $(ion_all_src) $(kandinsky_src) $(liba_src) $(libaxx_src) $(poincare_src) $(python_src) $(epsilon_src) $(runner_src) $(ion_target_device_flasher_light_src) $(ion_target_device_flasher_verbose_src) $(ion_target_device_bench_src) $(tests_src)
all_src = $(apps_all_src) $(escher_src) $(ion_all_src) $(kandinsky_src) $(liba_src) $(libaxx_src) $(poincare_src) $(python_src) $(runner_src) $(ion_target_device_flasher_light_src) $(ion_target_device_flasher_verbose_src) $(ion_target_device_bench_src) $(tests_src)
# Make palette.h a dep for every source-file.
# This ensures that the theming engine works correctly.
$(call object_for,$(all_app_src)): $(BUILD_DIR)/escher/palette.h

View File

@@ -94,7 +94,7 @@ $(BUILD_DIR)/apps/i18n.h: $(BUILD_DIR)/apps/i18n.cpp
$(eval $(call depends_on_image,apps/title_bar_view.cpp,apps/exam_icon.png))
all_app_src = $(app_src) $(epsilon_src) $(apps_launch_on_boarding_src) $(apps_launch_default_src) $(apps_prompt_none_src) $(apps_prompt_update_src) $(apps_prompt_beta_src) $(apps_official) $(apps_non_official) $(tests_src)
all_app_src = $(app_src)(apps_launch_on_boarding_src) $(apps_launch_default_src) $(apps_prompt_none_src) $(apps_prompt_update_src) $(apps_prompt_beta_src) $(apps_official) $(apps_non_official) $(tests_src)
$(call object_for,$(all_app_src)): $(BUILD_DIR)/apps/i18n.h
$(call object_for,$(all_app_src)): $(BUILD_DIR)/python/port/genhdr/qstrdefs.generated.h

View File

@@ -400,6 +400,9 @@ void ConsoleController::resetSandbox() {
}
void ConsoleController::refreshPrintOutput() {
if (sandboxIsDisplayed()) {
return;
}
m_selectableTableView.reloadData();
m_selectableTableView.selectCellAtLocation(0, m_consoleStore.numberOfLines());
if (m_preventEdition) {

View File

@@ -84,18 +84,7 @@ void GraphController::viewWillAppear() {
/* Since *m_selectedDotIndex is altered by initCursorParameters(),
* the following must absolutely come at the end. */
if (*m_selectedDotIndex >= 0) {
setRoundCrossCursorView(false);
} else {
setRoundCrossCursorView(true);
m_roundCursorView.setColor(Palette::DataColor[*m_selectedSeriesIndex]);
}
}
void GraphController::selectRegressionCurve() {
*m_selectedDotIndex = -1;
setRoundCrossCursorView(true);
m_roundCursorView.setColor(Palette::DataColor[*m_selectedSeriesIndex]);
setRoundCrossCursorView();
}
// Private
@@ -324,19 +313,22 @@ bool GraphController::moveCursorVertically(int direction) {
assert(!validDot || !validRegression);
/* The model should be up to date before setting the cursor view. */
if (validRegression) {
// Select the regression
*m_selectedSeriesIndex = closestRegressionSeries;
selectRegressionCurve();
*m_selectedDotIndex = -1;
setRoundCrossCursorView();
m_cursor->moveTo(x, x, yValue(*m_selectedSeriesIndex, x, context));
return true;
}
if (validDot) {
// Select the dot
setRoundCrossCursorView(false);
*m_selectedSeriesIndex = closestDotSeries;
*m_selectedDotIndex = dotSelected;
setRoundCrossCursorView();
if (dotSelected == m_store->numberOfPairsOfSeries(*m_selectedSeriesIndex)) {
// Select the mean dot
double x = m_store->meanOfColumn(*m_selectedSeriesIndex, 0);
@@ -404,8 +396,16 @@ InteractiveCurveViewRangeDelegate::Range GraphController::computeYRange(Interact
return range;
}
void GraphController::setRoundCrossCursorView(bool round) {
void GraphController::setRoundCrossCursorView() {
/* At this point, the model (selected series and dot indices) should be up
* to date. */
bool round = *m_selectedDotIndex < 0;
if (round) {
// Set the color although the cursor view stays round
m_roundCursorView.setColor(Palette::DataColor[*m_selectedSeriesIndex]);
}
CursorView * nextCursorView = round ? static_cast<Shared::CursorView *>(&m_roundCursorView) : static_cast<Shared::CursorView *>(&m_crossCursorView);
// Escape if the cursor view stays the same
if (m_view.cursorView() == nextCursorView) {
return;
}

View File

@@ -21,7 +21,7 @@ public:
bool isEmpty() const override;
I18n::Message emptyMessage() override;
void viewWillAppear() override;
void selectRegressionCurve();
void selectRegressionCurve() { *m_selectedDotIndex = -1; }
int selectedSeriesIndex() const { return *m_selectedSeriesIndex; }
// moveCursorHorizontally and Vertically are public to be used in tests
@@ -55,7 +55,7 @@ private:
// InteractiveCurveViewRangeDelegate
Shared::InteractiveCurveViewRangeDelegate::Range computeYRange(Shared::InteractiveCurveViewRange * interactiveCurveViewRange) override;
void setRoundCrossCursorView(bool round);
void setRoundCrossCursorView();
Shared::CursorView m_crossCursorView;
Shared::RoundCursorView m_roundCursorView;
BannerView m_bannerView;

View File

@@ -1,11 +1,11 @@
.PHONY: scenario_logger
scenario_logger:
$(Q) make -j8 PLATFORM=simulator clean && make -j8 DEBUG=1 ARCH=x86_64 PLATFORM=simulator epsilon.headless.bin
$(Q) $(MAKE) PLATFORM=simulator clean && $(MAKE) DEBUG=1 ARCH=x86_64 PLATFORM=simulator epsilon.headless.bin
$(Q) cp output/debug/simulator/macos/x86_64/epsilon.headless.bin epsilon_scenario_logger.bin
@echo "Run ./epsilon_scenario_logger.bin --logAfter 0 < scenario.esc to log a scenario"
.PHONY: scenario_creator
scenario_creator:
$(Q) make -j8 PLATFORM=simulator clean && make -j8 DEBUG=1 ESCHER_LOG_EVENTS_BINARY=1 PLATFORM=simulator
$(Q) $(MAKE) PLATFORM=simulator clean && $(MAKE) DEBUG=1 ESCHER_LOG_EVENTS_BINARY=1 PLATFORM=simulator
$(Q) cp -R output/debug/simulator/macos/app/Payload/Epsilon.app epsilon_scenario_creator.app
@echo "Run lldb epsilon_scenario_creator.app then process launch -o scenario.esc to create a scenario"

60
build/targets.all.mak Normal file
View File

@@ -0,0 +1,60 @@
ANDROID_GRADLE_KEYSTORE ?= ~/.gradle/google-play-upload.keystore
ANDROID_GRADLE_PROPERTIES ?= ~/.gradle/gradle.properties
IOS_MOBILE_PROVISION ?= build/artifacts/NumWorks_Graphing_Calculator_Distribution.mobileprovision
EMCC ?= emcc
define source_emsdk
source ~/emsdk/emsdk_env.sh > /dev/null
endef
define file_check
@ if test ! -f $(1); \
then \
echo "Missing file: $(1)"; \
exit 1; \
fi
endef
define command_check
@ if ! command -v $(1) > /dev/null; \
then \
echo "Missing command: $(1), did you forget to source?"; \
exit 1; \
fi
endef
.PHONY: all_official
all_official:
$(call file_check,$(ANDROID_GRADLE_KEYSTORE))
$(call file_check,$(ANDROID_GRADLE_PROPERTIES))
$(call file_check,$(IOS_MOBILE_PROVISION))
$(call command_check,$(EMCC))
$(Q) rm -rf output/stable_release
$(Q) mkdir -p output/stable_release
$(Q) echo "BUILD_FIRMWARE DEVICE N0110"
$(Q) $(MAKE) clean
$(Q) $(MAKE) epsilon.official.onboarding.dfu
$(Q) cp output/release/device/n0110/epsilon.official.onboarding.dfu output/stable_release/epsilon.device.n0110.dfu
$(Q) echo "BUILD_FIRMWARE DEVICE N0100"
$(Q) $(MAKE) MODEL=n0100 clean
$(Q) $(MAKE) MODEL=n0100 epsilon.official.onboarding.dfu
$(Q) cp output/release/device/n0100/epsilon.official.onboarding.dfu output/stable_release/epsilon.device.n0100.dfu
$(Q) echo "BUILD_FIRMWARE SIMULATOR WEB ZIP"
$(Q) $(MAKE) DEBUG=0 PLATFORM=simulator TARGET=web clean
$(Q) $(call source_emsdk); $(MAKE) DEBUG=0 PLATFORM=simulator TARGET=web output/release/simulator/web/simulator.official.zip
$(Q) cp output/release/simulator/web/simulator.official.zip output/stable_release/simulator.web.zip
$(Q) echo "BUILD_FIRMWARE SIMULATOR WEB JS"
$(Q) $(call source_emsdk); $(MAKE) DEBUG=0 PLATFORM=simulator TARGET=web epsilon.official.js
$(Q) cp output/release/simulator/web/epsilon.official.js output/stable_release/epsilon.js
$(Q) echo "BUILD_FIRMWARE SIMULATOR WEB PYTHON JS"
$(Q) $(MAKE) DEBUG=0 PLATFORM=simulator TARGET=web clean
$(Q) $(call source_emsdk); $(MAKE) DEBUG=0 PLATFORM=simulator TARGET=web EPSILON_GETOPT=1 EPSILON_APPS=code epsilon.official.js
$(Q) cp output/release/simulator/web/epsilon.official.js output/stable_release/epsilon.python.js
$(Q) echo "BUILD_FIRMWARE SIMULATOR ANDROID"
$(Q) $(MAKE) PLATFORM=simulator TARGET=android clean
$(Q) $(MAKE) PLATFORM=simulator TARGET=android epsilon.official.apk
$(Q) cp output/release/simulator/android/app/outputs/apk/release/android-release-unsigned.apk output/stable_release/epsilon.apk
$(Q) echo "BUILD_FIRMWARE SIMULATOR IOS"
$(Q) $(MAKE) PLATFORM=simulator TARGET=ios clean
$(Q) $(MAKE) PLATFORM=simulator TARGET=ios IOS_PROVISIONNING_PROFILE="~/Downloads/NumWorks_Graphing_Calculator_Distribution.mobileprovision" output/release/simulator/ios/app/epsilon.official.ipa
$(Q) cp output/release/simulator/ios/app/epsilon.official.ipa output/stable_release/epsilon.ipa

View File

@@ -26,24 +26,22 @@ $(BUILD_DIR)/test.external_flash.write.$(EXE): $(BUILD_DIR)/quiz/src/test_ion_ex
$(Q) $(OBJCOPY) -O binary -j .text.external -j .rodata.external -j .exam_mode_buffer $(BUILD_DIR)/$< $(BUILD_DIR)/$(basename $<).external.bin
$(Q) $(OBJCOPY) -O binary -R .text.external -R .rodata.external -R .exam_mode_buffer $(BUILD_DIR)/$< $(BUILD_DIR)/$(basename $<).internal.bin
@echo "Padding $(basename $<).external.bin and $(basename $<).internal.bin"
$(Q) printf "\xFF\xFF\xFF\xFF" >> $(basename $<).external.bin
$(Q) printf "\xFF\xFF\xFF\xFF" >> $(basename $<).internal.bin
$(Q) printf "\xFF\xFF\xFF\xFF" >> $(BUILD_DIR)/$(basename $<).external.bin
$(Q) printf "\xFF\xFF\xFF\xFF" >> $(BUILD_DIR)/$(basename $<).internal.bin
.PHONY: binpack
binpack:
rm -rf build/binpack
mkdir -p build/binpack
${MAKE} clean
${MAKE} $(BUILD_DIR)/flasher.light.bin
cp $(BUILD_DIR)/flasher.light.bin build/binpack
${MAKE} clean
${MAKE} $(BUILD_DIR)/bench.flash.bin
${MAKE} $(BUILD_DIR)/bench.ram.bin
cp $(BUILD_DIR)/bench.ram.bin $(BUILD_DIR)/bench.flash.bin build/binpack
${MAKE} clean
${MAKE} epsilon.onboarding.update.two_binaries
cp $(BUILD_DIR)/epsilon.onboarding.update.internal.bin $(BUILD_DIR)/epsilon.onboarding.update.external.bin build/binpack
${MAKE} clean
cd build && for binary in flasher.light.bin bench.flash.bin bench.ram.bin epsilon.onboarding.internal.bin epsilon.onboarding.external.bin; do shasum -a 256 -b binpack/$${binary} > binpack/$${binary}.sha256;done
cd build && tar cvfz binpack-`git rev-parse HEAD | head -c 7`.tgz binpack
rm -rf build/binpack
rm -rf output/binpack
mkdir -p output/binpack
$(MAKE) clean
$(MAKE) $(BUILD_DIR)/flasher.light.bin
cp $(BUILD_DIR)/flasher.light.bin output/binpack
$(MAKE) $(BUILD_DIR)/bench.flash.bin
$(MAKE) $(BUILD_DIR)/bench.ram.bin
cp $(BUILD_DIR)/bench.ram.bin $(BUILD_DIR)/bench.flash.bin output/binpack
$(MAKE) epsilon.official.onboarding.update.two_binaries
cp $(BUILD_DIR)/epsilon.official.onboarding.update.internal.bin $(BUILD_DIR)/epsilon.official.onboarding.update.external.bin output/binpack
$(MAKE) clean
cd output && for binary in flasher.light.bin bench.flash.bin bench.ram.bin epsilon.official.onboarding.update.internal.bin epsilon.official.onboarding.update.external.bin; do shasum -a 256 -b binpack/$${binary} > binpack/$${binary}.sha256;done
cd output && tar cvfz binpack-`git rev-parse HEAD | head -c 7`.tgz binpack
rm -rf output/binpack

View File

@@ -3,21 +3,15 @@ base_src = $(liba_src) $(kandinsky_src) $(escher_src) $(libaxx_src) $(poincare_s
epsilon_src = $(base_src) $(ion_default_src) $(apps_default_src)
epsilon_official_src = $(base_src) $(ion_default_src) $(apps_official_default_src)
epsilon_onboarding_src = $(base_src) $(ion_default_src) $(apps_onboarding_src)
epsilon_official_onboarding_src = $(base_src) $(ion_default_src) $(apps_official_onboarding_src)
epsilon_onboarding_update_src = $(base_src) $(ion_default_src) $(apps_onboarding_update_src)
epsilon_official_onboarding_update_src = $(base_src) $(ion_default_src) $(apps_official_onboarding_update_src)
epsilon_onboarding_beta_src = $(base_src) $(ion_default_src) $(apps_onboarding_beta_src)
epsilon_official_onboarding_beta_src = $(base_src) $(ion_default_src) $(apps_official_onboarding_beta_src)
$(BUILD_DIR)/epsilon.$(EXE): $(call object_for,$(epsilon_src))
$(BUILD_DIR)/epsilon.official.$(EXE): $(call object_for,$(epsilon_official_src))
$(BUILD_DIR)/epsilon.onboarding.$(EXE): $(call object_for,$(epsilon_onboarding_src))
$(BUILD_DIR)/epsilon.official.onboarding.$(EXE): $(call object_for,$(epsilon_official_onboarding_src))
$(BUILD_DIR)/epsilon.onboarding.update.$(EXE): $(call object_for,$(epsilon_onboarding_update_src))
$(BUILD_DIR)/epsilon.official.onboarding.update.$(EXE): $(call object_for,$(epsilon_official_onboarding_update_src))
$(BUILD_DIR)/epsilon.onboarding.beta.$(EXE): $(call object_for,$(epsilon_onboarding_beta_src))
$(BUILD_DIR)/epsilon.official.onboarding.beta.$(EXE): $(call object_for,$(epsilon_official_onboarding_beta_src))
$(BUILD_DIR)/epsilon.onboarding.$(EXE): $(call object_for, $(base_src) $(ion_default_src) $(apps_onboarding_src))
$(BUILD_DIR)/epsilon.official.onboarding.$(EXE): $(call object_for,$(base_src) $(ion_default_src) $(apps_official_onboarding_src))
$(BUILD_DIR)/epsilon.onboarding.update.$(EXE): $(call object_for, $(base_src) $(ion_default_src) $(apps_onboarding_update_src))
$(BUILD_DIR)/epsilon.official.onboarding.update.$(EXE): $(call object_for,$(base_src) $(ion_default_src) $(apps_official_onboarding_update_src))
$(BUILD_DIR)/epsilon.onboarding.beta.$(EXE): $(call object_for, $(base_src) $(ion_default_src) $(apps_onboarding_beta_src))
$(BUILD_DIR)/epsilon.official.onboarding.beta.$(EXE): $(call object_for,$(base_src) $(ion_default_src) $(apps_official_onboarding_beta_src))
test_base_src = $(base_src) $(apps_tests_src) $(runner_src) $(tests_src)
@@ -41,3 +35,5 @@ endef
-include build/targets.$(PLATFORM).mak
$(foreach extension,$(HANDY_TARGETS_EXTENSIONS),$(foreach executable,$(HANDY_TARGETS),$(eval $(call handy_target_rule,$(executable),$(extension)))))
include build/targets.all.mak

View File

@@ -1,17 +1,6 @@
$(BUILD_DIR)/epsilon.js: EMSCRIPTEN_INIT_FILE = 1
$(BUILD_DIR)/epsilon%packed.js: EMSCRIPTEN_INIT_FILE = 0
$(BUILD_DIR)/test.headless.js: EMSCRIPTEN_MODULARIZE = 0
$(BUILD_DIR)/epsilon.packed.js: $(call object_for,$(epsilon_src))
.PHONY: workshop_python_emulator
workshop_python_emulator:
$(MAKE) PLATFORM=simulator TARGET=web clean_for_apps_selection
$(MAKE) PLATFORM=simulator TARGET=web EPSILON_APPS=code
$(MAKE) PLATFORM=simulator TARGET=web clean_for_apps_selection
.PHONY: clean_for_apps_selection
clean_for_apps_selection:
@echo "CLEAN BEFORE CHANGING EPSILON_APPS"
$(Q) rm -f $(BUILD_DIR)/apps/apps_container_storage.o
$(Q) rm -f $(BUILD_DIR)/apps/i18n.*
$(BUILD_DIR)/epsilon.official.packed.js: $(call object_for,$(epsilon_official_src))

View File

@@ -132,7 +132,7 @@ EMFLAGS += -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0
# Configure LDFLAGS
EMSCRIPTEN_MODULARIZE ?= 1
LDFLAGS += -s MODULARIZE=$(EMSCRIPTEN_MODULARIZE) -s 'EXPORT_NAME="Epsilon"'
EMSCRIPTEN_INIT_FILE ?= 0
EMSCRIPTEN_INIT_FILE ?= 1
LDFLAGS += --memory-init-file $(EMSCRIPTEN_INIT_FILE)
SFLAGS += $(EMFLAGS)

View File

@@ -259,7 +259,7 @@ void Endpoint0::clearForOutTransactions(uint16_t wLength) {
setOutNAK(false);
}
uint16_t Endpoint0::receiveSomeData() {
int Endpoint0::receiveSomeData() {
// If it is the first chunk of data to be received, m_transferBufferLength is 0.
uint16_t packetSize = MIN(k_maxPacketSize, m_request.wLength() - m_transferBufferLength);
uint16_t sizeOfPacketRead = readPacket(m_largeBuffer + m_transferBufferLength, packetSize);

View File

@@ -57,7 +57,7 @@ public:
void clearForOutTransactions(uint16_t wLength);
private:
uint16_t receiveSomeData();
int receiveSomeData();
uint16_t readPacket(void * buffer, uint16_t length);
uint16_t writePacket(const void * buffer, uint16_t length);

View File

@@ -34,10 +34,15 @@ $(BUILD_DIR)/app/res/%.xml: ion/src/simulator/android/src/res/%.xml | $$(@D)/.
.PHONY: force_remake
$(BUILD_DIR)/app/libs/%/libepsilon.so: force_remake $$(@D)/.
$(Q) echo "MAKE NDK_ABI=$*"
$(Q) $(MAKE) NDK_ABI=$* epsilon.so
$(Q) cp $(BUILD_DIR)/$*/epsilon.so $@
define rule_for_libepsilon
$$(BUILD_DIR)/app/libs/%/lib$(1): force_remake $$$$(@D)/.
$(Q) echo "MAKE NDK_ABI=$$*"
$(Q) $$(MAKE) NDK_ABI=$$* $(1)
$(Q) cp $$(BUILD_DIR)/$$*/$(1) $$@
endef
$(eval $(call rule_for_libepsilon,epsilon.so))
$(eval $(call rule_for_libepsilon,epsilon.official.so))
# If NDK_ABI is not defined, we will re-trigger a build for each avaialble ABI.
# This is used to build APKs, which needs to embbed a binary for each ABI.
@@ -46,22 +51,28 @@ ifndef NDK_ABI
NDK_ABIS = armeabi-v7a arm64-v8a x86 x86_64
epsilon_apk_deps = $(patsubst %,$(BUILD_DIR)/app/libs/%/libepsilon.so,$(NDK_ABIS))
epsilon_apk_deps += $(subst ion/src/simulator/android/src/res,$(BUILD_DIR)/app/res,$(wildcard ion/src/simulator/android/src/res/*/*))
epsilon_apk_deps = $(subst ion/src/simulator/android/src/res,$(BUILD_DIR)/app/res,$(wildcard ion/src/simulator/android/src/res/*/*))
epsilon_apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ic_launcher_foreground.png)
.PHONY: gradle_%
gradle_%: $(epsilon_apk_deps)
define rule_for_gradle
.PHONY: gradle_$1_$2
gradle_$1_$2: $$(epsilon_apk_deps) $$(patsubst %,$$(BUILD_DIR)/app/libs/%/libepsilon$2so,$(NDK_ABIS))
@echo "GRADLE ion/src/simulator/android/build.gradle"
$(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle $*
$(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle $1
endef
$(eval $(call rule_for_gradle,assembleCodesigned,.))
$(eval $(call rule_for_gradle,assembleRelease,.))
$(eval $(call rule_for_gradle,assembleCodesigned,.official.))
$(eval $(call rule_for_gradle,assembleRelease,.official.))
DEFAULT = epsilon.apk
.PHONY: epsilon.apk
.PHONY: epsilon%apk
ifdef ANDROID_SIGNING_STORE_FILE
epsilon.apk: gradle_assembleCodesigned
epsilon%apk: gradle_assembleCodesigned_%
else
epsilon.apk: gradle_assembleRelease
epsilon%apk: gradle_assembleRelease_%
$(warning Building without code signing. Define ANDROID_SIGNING_STORE_FILE, ANDROID_SIGNING_STORE_PASSWORD, ANDROID_SIGNING_KEY_ALIAS and ANDROID_SIGNING_KEY_PASSWORD for a signed build.)
endif

View File

@@ -35,7 +35,7 @@ SIMULATOR_ICONSET = $(SIMULATOR_ASSETS_PATH)/AppIcon.appiconset
include ion/src/simulator/shared/apple/Makefile
$(call simulator_app_plist,Info.plist): ion/src/simulator/ios/Info.plist $(call simulator_app_resource,Assets.car)
$(call simulator_app_plist,%,Info.plist): ion/src/simulator/ios/Info.plist $(call simulator_app_resource,%,Assets.car)
$(call rule_label,PLUTIL)
$(Q) cp $< $@
$(Q) plutil -insert "BuildMachineOSBuild" -string "$(IOS_BUILD_MACHINE_OS_BUILD)" $@
@@ -54,22 +54,23 @@ $(call simulator_app_plist,Info.plist): ion/src/simulator/ios/Info.plist $(call
$(Q) plutil -replace CFBundleIcons -json `plutil -extract CFBundleIcons json -o - $(BUILD_DIR)/app/assets/partial.plist` $@
$(Q) plutil -replace CFBundleIcons~ipad -json `plutil -extract CFBundleIcons~ipad json -o - $(BUILD_DIR)/app/assets/partial.plist` $@
$(call simulator_app_resource,launch.storyboardc): ion/src/simulator/ios/launch.storyboard | $$(@D)/.
$(call simulator_app_resource,%,launch.storyboardc): ion/src/simulator/ios/launch.storyboard | $$(@D)/.
$(call rule_label,IBTOOL)
$(Q) $(IBTOOL) --minimum-deployment-target $(APPLE_PLATFORM_MIN_VERSION) --compile $@ $^
ifdef IOS_PROVISIONNING_PROFILE
$(call simulator_app_resource,embedded.mobileprovision): $(IOS_PROVISIONNING_PROFILE) | $$(@D)/.
$(call simulator_app_resource,%,embedded.mobileprovision): $(IOS_PROVISIONNING_PROFILE) | $$(@D)/.
$(call rule_label,COPY)
$(Q) cp $^ $@
$(BUILD_DIR)/app/entitlements.plist: $(call simulator_app_resource,embedded.mobileprovision)
$(BUILD_DIR)/app/entitlements.plist: $(IOS_PROVISIONNING_PROFILE)
$(call rule_label,SCMS)
$(Q) security cms -D -i $(IOS_PROVISIONNING_PROFILE) | plutil -extract Entitlements xml1 - -o $@
SIMULATOR_APP_DEPS += $(BUILD_DIR)/app/entitlements.plist
simulator_app_deps += $(BUILD_DIR)/app/entitlements.plist
simulator_app_deps += $(call simulator_app_resource,$1,embedded.mobileprovision)
else
$(call simulator_app_resource,embedded.mobileprovision):
$(call simulator_app_resource,%,embedded.mobileprovision):
$(warning Building without a provisionning profile. Please define IOS_PROVISIONNING_PROFILE to point to the .mobileprovision file you want to use.)
endif
@@ -77,19 +78,19 @@ $(SIMULATOR_ICONSET)/Contents.json: ion/src/simulator/ios/icon_assets.json $(SIM
$(call rule_label,COPY)
$(Q) cp $< $@
$(call simulator_app_resource,Assets.car): $(SIMULATOR_ICONSET)/Contents.json | $$(@D)/.
$(call simulator_app_resource,%,Assets.car): $(SIMULATOR_ICONSET)/Contents.json | $$(@D)/.
$(call rule_label,ACTOOL)
$(Q) $(ACTOOL) --compile $(BUILD_DIR)/app/Payload/Epsilon.app --minimum-deployment-target $(APPLE_PLATFORM_MIN_VERSION) --platform $(APPLE_SDK) --app-icon AppIcon --output-partial-info-plist $(BUILD_DIR)/app/assets/partial.plist $(SIMULATOR_ASSETS_PATH) > /dev/null
$(Q) $(ACTOOL) --compile $(BUILD_DIR)/app/Payload/$*.app --minimum-deployment-target $(APPLE_PLATFORM_MIN_VERSION) --platform $(APPLE_SDK) --app-icon AppIcon --output-partial-info-plist $(BUILD_DIR)/app/assets/partial.plist $(SIMULATOR_ASSETS_PATH) > /dev/null
SIMULATOR_APP_DEPS += $(call simulator_app_resource,\
simulator_app_deps += $(call simulator_app_resource,$(1), \
Assets.car \
launch.storyboardc \
)
$(BUILD_DIR)/app/epsilon.ipa: $(SIMULATOR_APP_DEPS)
$(BUILD_DIR)/app/epsilon%ipa: $(subst ..,.,$(call simulator_app_deps,Epsilon$*))
ifdef IOS_PROVISIONNING_PROFILE
$(call rule_label,SIGN)
$(Q) codesign --force --entitlements $(BUILD_DIR)/app/entitlements.plist --sign "iPhone Distribution: NumWorks" $(BUILD_DIR)/app/Payload/Epsilon.app
$(Q) codesign --force --entitlements $(BUILD_DIR)/app/entitlements.plist --sign "Apple Distribution: NumWorks" $(BUILD_DIR)/app/Payload/Epsilon.app
endif
$(call rule_label,ZIP)
$(Q) cd $(dir $@) ; zip -qr9 $(notdir $@) Payload
@@ -99,7 +100,7 @@ DEFAULT := $(BUILD_DIR)/app/epsilon.ipa
endif
ifeq ($(APPLE_PLATFORM),ios-simulator)
.PHONY: epsilon_run
epsilon_run: $(SIMULATOR_APP_DEPS)
xcrun simctl install booted $(BUILD_DIR)/app/Payload/Epsilon.app
.PHONY: epsilon%run
epsilon%run: $(subst _.,.,$(call simulator_app_deps,Epsilon$*))
xcrun simctl install booted $(BUILD_DIR)/app/Payload/Epsilon$(subst _,.,$*)app
endif

View File

@@ -22,7 +22,7 @@ SIMULATOR_ICONSET = $(BUILD_DIR)/app/assets/app.iconset
include ion/src/simulator/shared/apple/Makefile
$(call simulator_app_plist,Info.plist): ion/src/simulator/macos/Info.plist
$(call simulator_app_plist,%,Info.plist): ion/src/simulator/macos/Info.plist
$(call rule_label,PLUTIL)
$(Q) cp $< $@
$(Q) plutil -insert "LSMinimumSystemVersion" -string "$(MACOS_MIN_VERSION)" $@
@@ -31,12 +31,21 @@ $(call simulator_app_plist,Info.plist): ion/src/simulator/macos/Info.plist
# macOS uses icns files
$(call simulator_app_resource,app.icns): $(SIMULATOR_ICONS) | $$(@D)/.
.SECONDARY: $(SIMULATOR_ICONS) | $$(@D)/.
$(call simulator_app_resource,%,app.icns): $(SIMULATOR_ICONS) | $$(@D)/.
$(call rule_label,ICNUTIL)
$(Q) iconutil --convert icns --output $@ $(SIMULATOR_ICONSET)
SIMULATOR_APP_DEPS += $(call simulator_app_resource,app.icns)
simulator_app_deps += $(call simulator_app_resource,$(1),app.icns)
simulator_app_deps_unofficial = $(call simulator_app_deps,Epsilon)
simulator_app_deps_official = $(call simulator_app_deps,Epsilon.official)
.PHONY: Epsilon.app Epsilon.official.app
Epsilon.app: $(simulator_app_deps_unofficial)
Epsilon.official.app: $(simulator_app_deps_official)
ifndef ARCH
DEFAULT := $(SIMULATOR_APP_DEPS)
DEFAULT := Epsilon.app
endif

View File

@@ -2,27 +2,37 @@
# The only things that have to be customized per platform are the icons and the
# Info.plist.
SIMULATOR_APP_PATH = $(BUILD_DIR)/app/Payload/Epsilon.app
SIMULATOR_APP_PATH = $(BUILD_DIR)/app/Payload
simulator_app_binary = $(addprefix $(SIMULATOR_APP_PATH)/$(SIMULATOR_APP_BINARY_PATH),$(1))
simulator_app_resource = $(addprefix $(SIMULATOR_APP_PATH)/$(SIMULATOR_APP_RESOURCE_PATH),$(1))
simulator_app_plist = $(addprefix $(SIMULATOR_APP_PATH)/$(SIMULATOR_APP_PLIST_PATH),$(1))
simulator_app_binary = $(addprefix $(SIMULATOR_APP_PATH)/$(1).app/$(SIMULATOR_APP_BINARY_PATH),$(2))
simulator_app_resource = $(addprefix $(SIMULATOR_APP_PATH)/$(1).app/$(SIMULATOR_APP_RESOURCE_PATH),$(2))
simulator_app_plist = $(addprefix $(SIMULATOR_APP_PATH)/$(1).app/$(SIMULATOR_APP_PLIST_PATH),$(2))
# Epsilon binary
.PHONY: force_remake
$(BUILD_DIR)/%/epsilon.bin: force_remake
$(Q) echo "MAKE ARCH=$*"
$(Q) $(MAKE) ARCH=$*
define rule_for_epsilon
$$(BUILD_DIR)/%/$(1): force_remake
$(Q) echo "MAKE ARCH=$$*"
$(Q) $$(MAKE) ARCH=$$* $(1)
endef
$(call simulator_app_binary,Epsilon): $(patsubst %,$(BUILD_DIR)/%/epsilon.bin,$(ARCHS)) | $$(@D)/.
$(call rule_label,LIPO)
$(Q) $(LIPO) -create $^ -output $@
$(eval $(call rule_for_epsilon,epsilon.bin))
$(eval $(call rule_for_epsilon,epsilon.official.bin))
define rule_for_lipo
$$(call simulator_app_binary,$1,Epsilon): $$(patsubst %,$(BUILD_DIR)/%/$2.bin,$$(ARCHS)) | $$$$(@D)/.
$$(call rule_label,LIPO)
$(Q) $$(LIPO) -create $$^ -output $$@
endef
$(eval $(call rule_for_lipo,Epsilon,epsilon))
$(eval $(call rule_for_lipo,Epsilon.official,epsilon.official))
# Background image
$(call simulator_app_resource,background.jpg): ion/src/simulator/assets/background.jpg | $$(@D)/.
$(call simulator_app_resource,%,background.jpg): ion/src/simulator/assets/background.jpg | $$(@D)/.
$(call rule_label,COPY)
$(Q) cp $^ $@
@@ -44,6 +54,6 @@ $(addprefix $(SIMULATOR_ICONSET)/,icon_%.png): ion/src/simulator/assets/logo.svg
# Export simulator app dependencies
SIMULATOR_APP_DEPS += $(call simulator_app_binary,Epsilon)
SIMULATOR_APP_DEPS += $(call simulator_app_plist,Info.plist)
SIMULATOR_APP_DEPS += $(call simulator_app_resource,background.jpg)
simulator_app_deps += $(call simulator_app_binary,$(1),Epsilon)
simulator_app_deps += $(call simulator_app_plist,$(1),Info.plist)
simulator_app_deps += $(call simulator_app_resource,$(1),background.jpg)

View File

@@ -26,7 +26,7 @@ endif
DEFAULT = $(BUILD_DIR)/simulator.zip
$(BUILD_DIR)/simulator.zip: $(BUILD_DIR)/epsilon.packed.js
$(BUILD_DIR)/simulator%zip: $(BUILD_DIR)/epsilon%packed.js
@rm -rf $(basename $@)
@mkdir -p $(basename $@)
@cp $^ $(basename $@)/epsilon.js