#!/usr/bin/env bash cd "$(dirname "$0")" source ./script/setup.sh export XCODEGEN_AEROSPACE_CODE_SIGN_IDENTITY="deewm-codesign-certificate" build_version="0.0.0-SNAPSHOT" generate_xcodeproj=1 generate_cmd_help=1 generate_git_hash=0 while test $# -gt 0; do case $1 in --build-version) build_version="$2"; shift 2 ;; --codesign-identity) XCODEGEN_AEROSPACE_CODE_SIGN_IDENTITY="$2"; shift 2 ;; --generate-git-hash) generate_git_hash=1; shift 1;; --ignore-cmd-help) generate_cmd_help=0; shift 1 ;; --ignore-xcodeproj) generate_xcodeproj=0; shift 1 ;; *) echo "Unknown option $1"; exit 1 ;; esac done if test $generate_cmd_help = 1; then # It takes 300ms for the script to complete ./script/generate-cmd-help.sh fi cat > Sources/Common/versionGenerated.swift < ./Sources/Cli/subcommandDescriptionsGenerated.swift // FILE IS GENERATED FROM docs/aerospace-*.adoc files // TO REGENERATE THE FILE RUN generate.sh let subcommandDescriptions = [ $(entries) ] EOF cat < ./Sources/Common/gitHashGenerated.swift // FILE IS GENERATED BY generate.sh public let gitHash = "$(if test $generate_git_hash = 0; then echo "SNAPSHOT"; else git rev-parse HEAD; fi)" public let gitShortHash = "$(if test $generate_git_hash = 0; then echo "SNAPSHOT"; else git rev-parse --short HEAD; fi)" EOF if test $generate_xcodeproj = 1; then export XCODEGEN_AEROSPACE_VERSION=$build_version ./script/install-dep.sh --xcodegen cd xcode ../.deps/xcodegen/xcodegen # https://github.com/yonaskolb/XcodeGen fi