From cc2f3b9fbdd0fdd90de9e03306a7c93b8be87e21 Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Tue, 23 Apr 2024 11:21:46 -0400 Subject: [PATCH] some rename and release/ci workflows --- .github/workflows/build.yml | 25 +-- .github/workflows/ci.yml | 14 ++ .github/workflows/release.yml | 68 +++++++ .../project.pbxproj | 168 ++++++++++-------- .../contents.xcworkspacedata | 2 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/WorkspaceSettings.xcsettings | 0 .../xcshareddata/xcschemes/Barista.xcscheme | 32 ++-- README.md | 2 +- barista/ContentView.swift | 2 +- barista/Info.plist | 9 +- barista/baristaApp.swift | 8 +- baristaTests/baristaTests.swift | 8 +- baristaUITests/baristaUITests.swift | 6 +- .../baristaUITestsLaunchTests.swift | 6 +- 15 files changed, 225 insertions(+), 125 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml rename {barista.xcodeproj => Barista.xcodeproj}/project.pbxproj (77%) rename {barista.xcodeproj => Barista.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (58%) rename {barista.xcodeproj => Barista.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {barista.xcodeproj => Barista.xcodeproj}/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (100%) rename barista.xcodeproj/xcshareddata/xcschemes/barista.xcscheme => Barista.xcodeproj/xcshareddata/xcschemes/Barista.xcscheme (79%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84adef4..b8904dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,13 @@ -name: Build barista +name: Build Barista on: - workflow_dispatch: workflow_call: - pull_request: - push: - branches: - - main + inputs: + save: + description: "Whether to save as an artifact." + default: false + required: false + type: boolean jobs: build: @@ -14,19 +15,19 @@ jobs: runs-on: macos-14 steps: - name: Checkout repository - if: matrix.info.container == '' uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 1 - name: Build run: | - mkdir ./release - xcodebuild -scheme barista -configuration Pre -derivedDataPath "release/DerivedData" -archivePath "release/CodeEdit.xcarchive" -skipPackagePluginValidation archive + mkdir ./build_artifacts + xcodebuild -scheme Barista -derivedDataPath "build_artifacts/DerivedData" -archivePath "build_artifacts/Barista.xcarchive" -skipPackagePluginValidation archive - - name: Save release as artifact + - name: Save build as artifact + if: inputs.save uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: retention-days: 3 - name: release - path: release + name: build_artifacts + path: build_artifacts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4ee22a8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,14 @@ +name: CI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +jobs: + test-build: + uses: ./.github/workflows/build.yml + with: + save: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f20c42e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +# Builds and releases a .dmg file. + +name: Release Barista + +on: + workflow_dispatch: + +jobs: + build-release: + uses: ./.github/workflows/build.yml + with: + save: true + + upload-release: + name: upload-release + runs-on: ubuntu-latest + needs: [build-release] + steps: + - name: Get build artifacts + uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 + with: + pattern: build_artifacts + path: build_artifacts + merge-multiple: true + + - name: Generate dmg + run: | + npm install --global create-dmg + mkdir release + create-dmg "build_artifacts/Barista.app" "release" + + - name: Print out all release files + run: | + echo "Generated $(ls ./release | wc -l) files:" + du -h -d 0 ./release/* + + - name: Get app version and build number + run: | + APP_VERSION=$(xcrun agvtool mvers -terse1) + APP_BUILD=$(xcrun agvtool vers -terse) + echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV + echo "APP_BUILD=$APP_BUILD" >> $GITHUB_ENV + + - name: Create release and add release files + uses: softprops/action-gh-release@20e085ccc73308c2c8e43ab8da4f8d7ecbb94d4e # 2.0.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + prerelease: false + tag_name: ${{ env.APP_VERSION }}-${{env.APP_BUILD}} + draft: true + fail_on_unmatched_files: true + name: ${{ env.APP_VERSION }}-${{env.APP_BUILD}} Release + body: | + + + --- + + ## Bug Fixes + + ## Features + + ## Changes + + ## Other + + ## Internal Changes + files: | + ./build/* diff --git a/barista.xcodeproj/project.pbxproj b/Barista.xcodeproj/project.pbxproj similarity index 77% rename from barista.xcodeproj/project.pbxproj rename to Barista.xcodeproj/project.pbxproj index c18dad5..2e22d6d 100644 --- a/barista.xcodeproj/project.pbxproj +++ b/Barista.xcodeproj/project.pbxproj @@ -7,13 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - A49ADD242B0C607500166231 /* baristaApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD232B0C607500166231 /* baristaApp.swift */; }; + A49ADD242B0C607500166231 /* BaristaApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD232B0C607500166231 /* BaristaApp.swift */; }; A49ADD262B0C607500166231 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD252B0C607500166231 /* ContentView.swift */; }; A49ADD282B0C607600166231 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A49ADD272B0C607600166231 /* Assets.xcassets */; }; A49ADD2B2B0C607600166231 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A49ADD2A2B0C607600166231 /* Preview Assets.xcassets */; }; - A49ADD362B0C607600166231 /* baristaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD352B0C607600166231 /* baristaTests.swift */; }; - A49ADD402B0C607600166231 /* baristaUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD3F2B0C607600166231 /* baristaUITests.swift */; }; - A49ADD422B0C607600166231 /* baristaUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD412B0C607600166231 /* baristaUITestsLaunchTests.swift */; }; + A49ADD362B0C607600166231 /* BaristaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD352B0C607600166231 /* BaristaTests.swift */; }; + A49ADD402B0C607600166231 /* BaristaUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD3F2B0C607600166231 /* BaristaUITests.swift */; }; + A49ADD422B0C607600166231 /* BaristaUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A49ADD412B0C607600166231 /* BaristaUITestsLaunchTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -22,29 +22,29 @@ containerPortal = A49ADD182B0C607500166231 /* Project object */; proxyType = 1; remoteGlobalIDString = A49ADD1F2B0C607500166231; - remoteInfo = barista; + remoteInfo = Barista; }; A49ADD3C2B0C607600166231 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A49ADD182B0C607500166231 /* Project object */; proxyType = 1; remoteGlobalIDString = A49ADD1F2B0C607500166231; - remoteInfo = barista; + remoteInfo = Barista; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - A49ADD202B0C607500166231 /* barista.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = barista.app; sourceTree = BUILT_PRODUCTS_DIR; }; - A49ADD232B0C607500166231 /* baristaApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = baristaApp.swift; sourceTree = ""; }; + A49ADD202B0C607500166231 /* Barista.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Barista.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A49ADD232B0C607500166231 /* BaristaApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaristaApp.swift; sourceTree = ""; }; A49ADD252B0C607500166231 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; A49ADD272B0C607600166231 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; A49ADD2A2B0C607600166231 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - A49ADD2C2B0C607600166231 /* barista.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = barista.entitlements; sourceTree = ""; }; - A49ADD312B0C607600166231 /* baristaTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = baristaTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A49ADD352B0C607600166231 /* baristaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = baristaTests.swift; sourceTree = ""; }; - A49ADD3B2B0C607600166231 /* baristaUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = baristaUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A49ADD3F2B0C607600166231 /* baristaUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = baristaUITests.swift; sourceTree = ""; }; - A49ADD412B0C607600166231 /* baristaUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = baristaUITestsLaunchTests.swift; sourceTree = ""; }; + A49ADD2C2B0C607600166231 /* Barista.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Barista.entitlements; sourceTree = ""; }; + A49ADD312B0C607600166231 /* BaristaTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BaristaTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A49ADD352B0C607600166231 /* BaristaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaristaTests.swift; sourceTree = ""; }; + A49ADD3B2B0C607600166231 /* BaristaUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BaristaUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A49ADD3F2B0C607600166231 /* BaristaUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaristaUITests.swift; sourceTree = ""; }; + A49ADD412B0C607600166231 /* BaristaUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaristaUITestsLaunchTests.swift; sourceTree = ""; }; A49ADD4E2B0CAC9100166231 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -76,9 +76,9 @@ A49ADD172B0C607500166231 = { isa = PBXGroup; children = ( - A49ADD222B0C607500166231 /* barista */, - A49ADD342B0C607600166231 /* baristaTests */, - A49ADD3E2B0C607600166231 /* baristaUITests */, + A49ADD222B0C607500166231 /* Barista */, + A49ADD342B0C607600166231 /* BaristaTests */, + A49ADD3E2B0C607600166231 /* BaristaUITests */, A49ADD212B0C607500166231 /* Products */, ); sourceTree = ""; @@ -86,24 +86,24 @@ A49ADD212B0C607500166231 /* Products */ = { isa = PBXGroup; children = ( - A49ADD202B0C607500166231 /* barista.app */, - A49ADD312B0C607600166231 /* baristaTests.xctest */, - A49ADD3B2B0C607600166231 /* baristaUITests.xctest */, + A49ADD202B0C607500166231 /* Barista.app */, + A49ADD312B0C607600166231 /* BaristaTests.xctest */, + A49ADD3B2B0C607600166231 /* BaristaUITests.xctest */, ); name = Products; sourceTree = ""; }; - A49ADD222B0C607500166231 /* barista */ = { + A49ADD222B0C607500166231 /* Barista */ = { isa = PBXGroup; children = ( A49ADD4E2B0CAC9100166231 /* Info.plist */, - A49ADD232B0C607500166231 /* baristaApp.swift */, + A49ADD232B0C607500166231 /* BaristaApp.swift */, A49ADD252B0C607500166231 /* ContentView.swift */, A49ADD272B0C607600166231 /* Assets.xcassets */, - A49ADD2C2B0C607600166231 /* barista.entitlements */, + A49ADD2C2B0C607600166231 /* Barista.entitlements */, A49ADD292B0C607600166231 /* Preview Content */, ); - path = barista; + path = Barista; sourceTree = ""; }; A49ADD292B0C607600166231 /* Preview Content */ = { @@ -114,29 +114,29 @@ path = "Preview Content"; sourceTree = ""; }; - A49ADD342B0C607600166231 /* baristaTests */ = { + A49ADD342B0C607600166231 /* BaristaTests */ = { isa = PBXGroup; children = ( - A49ADD352B0C607600166231 /* baristaTests.swift */, + A49ADD352B0C607600166231 /* BaristaTests.swift */, ); - path = baristaTests; + path = BaristaTests; sourceTree = ""; }; - A49ADD3E2B0C607600166231 /* baristaUITests */ = { + A49ADD3E2B0C607600166231 /* BaristaUITests */ = { isa = PBXGroup; children = ( - A49ADD3F2B0C607600166231 /* baristaUITests.swift */, - A49ADD412B0C607600166231 /* baristaUITestsLaunchTests.swift */, + A49ADD3F2B0C607600166231 /* BaristaUITests.swift */, + A49ADD412B0C607600166231 /* BaristaUITestsLaunchTests.swift */, ); - path = baristaUITests; + path = BaristaUITests; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - A49ADD1F2B0C607500166231 /* barista */ = { + A49ADD1F2B0C607500166231 /* Barista */ = { isa = PBXNativeTarget; - buildConfigurationList = A49ADD452B0C607600166231 /* Build configuration list for PBXNativeTarget "barista" */; + buildConfigurationList = A49ADD452B0C607600166231 /* Build configuration list for PBXNativeTarget "Barista" */; buildPhases = ( A49ADD1C2B0C607500166231 /* Sources */, A49ADD1D2B0C607500166231 /* Frameworks */, @@ -146,14 +146,14 @@ ); dependencies = ( ); - name = barista; - productName = barista; - productReference = A49ADD202B0C607500166231 /* barista.app */; + name = Barista; + productName = Barista; + productReference = A49ADD202B0C607500166231 /* Barista.app */; productType = "com.apple.product-type.application"; }; - A49ADD302B0C607600166231 /* baristaTests */ = { + A49ADD302B0C607600166231 /* BaristaTests */ = { isa = PBXNativeTarget; - buildConfigurationList = A49ADD482B0C607600166231 /* Build configuration list for PBXNativeTarget "baristaTests" */; + buildConfigurationList = A49ADD482B0C607600166231 /* Build configuration list for PBXNativeTarget "BaristaTests" */; buildPhases = ( A49ADD2D2B0C607600166231 /* Sources */, A49ADD2E2B0C607600166231 /* Frameworks */, @@ -164,14 +164,14 @@ dependencies = ( A49ADD332B0C607600166231 /* PBXTargetDependency */, ); - name = baristaTests; - productName = baristaTests; - productReference = A49ADD312B0C607600166231 /* baristaTests.xctest */; + name = BaristaTests; + productName = BaristaTests; + productReference = A49ADD312B0C607600166231 /* BaristaTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - A49ADD3A2B0C607600166231 /* baristaUITests */ = { + A49ADD3A2B0C607600166231 /* BaristaUITests */ = { isa = PBXNativeTarget; - buildConfigurationList = A49ADD4B2B0C607600166231 /* Build configuration list for PBXNativeTarget "baristaUITests" */; + buildConfigurationList = A49ADD4B2B0C607600166231 /* Build configuration list for PBXNativeTarget "BaristaUITests" */; buildPhases = ( A49ADD372B0C607600166231 /* Sources */, A49ADD382B0C607600166231 /* Frameworks */, @@ -182,9 +182,9 @@ dependencies = ( A49ADD3D2B0C607600166231 /* PBXTargetDependency */, ); - name = baristaUITests; - productName = baristaUITests; - productReference = A49ADD3B2B0C607600166231 /* baristaUITests.xctest */; + name = BaristaUITests; + productName = BaristaUITests; + productReference = A49ADD3B2B0C607600166231 /* BaristaUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; /* End PBXNativeTarget section */ @@ -195,7 +195,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1500; - LastUpgradeCheck = 1500; + LastUpgradeCheck = 1530; TargetAttributes = { A49ADD1F2B0C607500166231 = { CreatedOnToolsVersion = 15.0.1; @@ -210,7 +210,7 @@ }; }; }; - buildConfigurationList = A49ADD1B2B0C607500166231 /* Build configuration list for PBXProject "barista" */; + buildConfigurationList = A49ADD1B2B0C607500166231 /* Build configuration list for PBXProject "Barista" */; compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; @@ -223,9 +223,9 @@ projectDirPath = ""; projectRoot = ""; targets = ( - A49ADD1F2B0C607500166231 /* barista */, - A49ADD302B0C607600166231 /* baristaTests */, - A49ADD3A2B0C607600166231 /* baristaUITests */, + A49ADD1F2B0C607500166231 /* Barista */, + A49ADD302B0C607600166231 /* BaristaTests */, + A49ADD3A2B0C607600166231 /* BaristaUITests */, ); }; /* End PBXProject section */ @@ -262,7 +262,7 @@ buildActionMask = 2147483647; files = ( A49ADD262B0C607500166231 /* ContentView.swift in Sources */, - A49ADD242B0C607500166231 /* baristaApp.swift in Sources */, + A49ADD242B0C607500166231 /* BaristaApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -270,7 +270,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A49ADD362B0C607600166231 /* baristaTests.swift in Sources */, + A49ADD362B0C607600166231 /* BaristaTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -278,8 +278,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A49ADD402B0C607600166231 /* baristaUITests.swift in Sources */, - A49ADD422B0C607600166231 /* baristaUITestsLaunchTests.swift in Sources */, + A49ADD402B0C607600166231 /* BaristaUITests.swift in Sources */, + A49ADD422B0C607600166231 /* BaristaUITestsLaunchTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -288,12 +288,12 @@ /* Begin PBXTargetDependency section */ A49ADD332B0C607600166231 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = A49ADD1F2B0C607500166231 /* barista */; + target = A49ADD1F2B0C607500166231 /* Barista */; targetProxy = A49ADD322B0C607600166231 /* PBXContainerItemProxy */; }; A49ADD3D2B0C607600166231 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = A49ADD1F2B0C607500166231 /* barista */; + target = A49ADD1F2B0C607500166231 /* Barista */; targetProxy = A49ADD3C2B0C607600166231 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -333,6 +333,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -396,6 +397,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -422,15 +424,17 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = barista/barista.entitlements; + CODE_SIGN_ENTITLEMENTS = Barista/Barista.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"barista/Preview Content\""; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_ASSET_PATHS = "\"Barista/Preview Content\""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = barista/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = ""; + INFOPLIST_FILE = Barista/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Barista; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( @@ -438,7 +442,7 @@ "@executable_path/../Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = clementtsang.barista; + PRODUCT_BUNDLE_IDENTIFIER = clementtsang.Barista; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -450,15 +454,17 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = barista/barista.entitlements; + CODE_SIGN_ENTITLEMENTS = Barista/Barista.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"barista/Preview Content\""; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_ASSET_PATHS = "\"Barista/Preview Content\""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = barista/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = ""; + INFOPLIST_FILE = Barista/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Barista; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( @@ -466,7 +472,7 @@ "@executable_path/../Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = clementtsang.barista; + PRODUCT_BUNDLE_IDENTIFIER = clementtsang.Barista; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -480,14 +486,15 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; GENERATE_INFOPLIST_FILE = YES; MACOSX_DEPLOYMENT_TARGET = 13.6; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = clementtsang.baristaTests; + PRODUCT_BUNDLE_IDENTIFIER = clementtsang.BaristaTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/barista.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/barista"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Barista.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Barista"; }; name = Debug; }; @@ -498,14 +505,15 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; GENERATE_INFOPLIST_FILE = YES; MACOSX_DEPLOYMENT_TARGET = 13.6; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = clementtsang.baristaTests; + PRODUCT_BUNDLE_IDENTIFIER = clementtsang.BaristaTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/barista.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/barista"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Barista.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Barista"; }; name = Release; }; @@ -515,13 +523,14 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = clementtsang.baristaUITests; + PRODUCT_BUNDLE_IDENTIFIER = clementtsang.BaristaUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; - TEST_TARGET_NAME = barista; + TEST_TARGET_NAME = Barista; }; name = Debug; }; @@ -531,20 +540,21 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = clementtsang.baristaUITests; + PRODUCT_BUNDLE_IDENTIFIER = clementtsang.BaristaUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; - TEST_TARGET_NAME = barista; + TEST_TARGET_NAME = Barista; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - A49ADD1B2B0C607500166231 /* Build configuration list for PBXProject "barista" */ = { + A49ADD1B2B0C607500166231 /* Build configuration list for PBXProject "Barista" */ = { isa = XCConfigurationList; buildConfigurations = ( A49ADD432B0C607600166231 /* Debug */, @@ -553,7 +563,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A49ADD452B0C607600166231 /* Build configuration list for PBXNativeTarget "barista" */ = { + A49ADD452B0C607600166231 /* Build configuration list for PBXNativeTarget "Barista" */ = { isa = XCConfigurationList; buildConfigurations = ( A49ADD462B0C607600166231 /* Debug */, @@ -562,7 +572,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A49ADD482B0C607600166231 /* Build configuration list for PBXNativeTarget "baristaTests" */ = { + A49ADD482B0C607600166231 /* Build configuration list for PBXNativeTarget "BaristaTests" */ = { isa = XCConfigurationList; buildConfigurations = ( A49ADD492B0C607600166231 /* Debug */, @@ -571,7 +581,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A49ADD4B2B0C607600166231 /* Build configuration list for PBXNativeTarget "baristaUITests" */ = { + A49ADD4B2B0C607600166231 /* Build configuration list for PBXNativeTarget "BaristaUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( A49ADD4C2B0C607600166231 /* Debug */, diff --git a/barista.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Barista.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 58% rename from barista.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Barista.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a..11fd733 100644 --- a/barista.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/Barista.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:/Users/clement.tsang/repos/Barista/Barista.xcodeproj"> diff --git a/barista.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Barista.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from barista.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Barista.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/barista.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Barista.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from barista.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to Barista.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/barista.xcodeproj/xcshareddata/xcschemes/barista.xcscheme b/Barista.xcodeproj/xcshareddata/xcschemes/Barista.xcscheme similarity index 79% rename from barista.xcodeproj/xcshareddata/xcschemes/barista.xcscheme rename to Barista.xcodeproj/xcshareddata/xcschemes/Barista.xcscheme index 4005d83..caafad5 100644 --- a/barista.xcodeproj/xcshareddata/xcschemes/barista.xcscheme +++ b/Barista.xcodeproj/xcshareddata/xcschemes/Barista.xcscheme @@ -1,6 +1,6 @@ + BuildableName = "Barista.app" + BlueprintName = "Barista" + ReferencedContainer = "container:Barista.xcodeproj"> @@ -35,9 +35,9 @@ + BuildableName = "BaristaTests.xctest" + BlueprintName = "BaristaTests" + ReferencedContainer = "container:Barista.xcodeproj"> + BuildableName = "BaristaUITests.xctest" + BlueprintName = "BaristaUITests" + ReferencedContainer = "container:Barista.xcodeproj"> @@ -68,9 +68,9 @@ + BuildableName = "Barista.app" + BlueprintName = "Barista" + ReferencedContainer = "container:Barista.xcodeproj"> @@ -85,9 +85,9 @@ + BuildableName = "Barista.app" + BlueprintName = "Barista" + ReferencedContainer = "container:Barista.xcodeproj"> diff --git a/README.md b/README.md index a3017a1..fc74d32 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ A small tray frontend for macOS's `caffeinate`. Note: currently does not replicate 100% of the features of `caffeinate`. -image +image diff --git a/barista/ContentView.swift b/barista/ContentView.swift index 84fef15..f9e5c8e 100644 --- a/barista/ContentView.swift +++ b/barista/ContentView.swift @@ -1,6 +1,6 @@ // // ContentView.swift -// barista +// Barista // // Created by Clement Tsang on 2023-11-20. // diff --git a/barista/Info.plist b/barista/Info.plist index 0c67376..0fff697 100644 --- a/barista/Info.plist +++ b/barista/Info.plist @@ -1,5 +1,12 @@ - + + CFBundleVersion + 1.0 + CFBundleShortVersionString + 1.0 + CFBundleGetInfoString + + diff --git a/barista/baristaApp.swift b/barista/baristaApp.swift index aa72028..95a29a2 100644 --- a/barista/baristaApp.swift +++ b/barista/baristaApp.swift @@ -29,7 +29,7 @@ enum CaffeinateState: Equatable { } @main -struct baristaApp: App { +struct BaristaApp: App { @State var isCaffeinateEnabled = false var body: some Scene { @@ -120,7 +120,7 @@ struct BaristaMenu: View { Divider() - let baristaToggleDescription = if isCaffeinateEnabled { + let BaristaToggleDescription = if isCaffeinateEnabled { switch (caffeinateRunState) { case let .starting(process): "Barista is starting (PID: \(process.processIdentifier))" @@ -139,7 +139,7 @@ struct BaristaMenu: View { HStack { VStack(alignment: .leading) { Text("Enable Barista").font(.system(size: 12)).fontWeight(.semibold) - Text(baristaToggleDescription).font(.system(size: 10)) + Text(BaristaToggleDescription).font(.system(size: 10)) } Spacer() Toggle("Enable Barista", isOn: $isCaffeinateEnabled).toggleStyle(.switch).labelsHidden() @@ -151,7 +151,7 @@ struct BaristaMenu: View { HStack(alignment: .center, spacing: 8.0) { Button(action: { - openURL(URL(string: "https://github.com/ClementTsang/barista")!) + openURL(URL(string: "https://github.com/ClementTsang/Barista")!) }) { Text("GitHub") }.buttonStyle(.borderless) diff --git a/baristaTests/baristaTests.swift b/baristaTests/baristaTests.swift index 21419e1..d3df6a1 100644 --- a/baristaTests/baristaTests.swift +++ b/baristaTests/baristaTests.swift @@ -1,14 +1,14 @@ // -// baristaTests.swift -// baristaTests +// BaristaTests.swift +// BaristaTests // // Created by Clement Tsang on 2023-11-20. // import XCTest -@testable import barista +@testable import Barista -final class baristaTests: XCTestCase { +final class BaristaTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. diff --git a/baristaUITests/baristaUITests.swift b/baristaUITests/baristaUITests.swift index f023c26..364bb69 100644 --- a/baristaUITests/baristaUITests.swift +++ b/baristaUITests/baristaUITests.swift @@ -1,13 +1,13 @@ // -// baristaUITests.swift -// baristaUITests +// BaristaUITests.swift +// BaristaUITests // // Created by Clement Tsang on 2023-11-20. // import XCTest -final class baristaUITests: XCTestCase { +final class BaristaUITests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. diff --git a/baristaUITests/baristaUITestsLaunchTests.swift b/baristaUITests/baristaUITestsLaunchTests.swift index 69cf4ac..e0bd843 100644 --- a/baristaUITests/baristaUITestsLaunchTests.swift +++ b/baristaUITests/baristaUITestsLaunchTests.swift @@ -1,13 +1,13 @@ // -// baristaUITestsLaunchTests.swift -// baristaUITests +// BaristaUITestsLaunchTests.swift +// BaristaUITests // // Created by Clement Tsang on 2023-11-20. // import XCTest -final class baristaUITestsLaunchTests: XCTestCase { +final class BaristaUITestsLaunchTests: XCTestCase { override class var runsForEachTargetApplicationUIConfiguration: Bool { true