Skip to content

Commit

Permalink
Merge pull request #2 from GeorgeLyon/dev/george/better-layout
Browse files Browse the repository at this point in the history
[iOS] Even better layout, more tests
  • Loading branch information
GeorgeLyon authored Nov 10, 2024
2 parents ca511d7 + 3ceac0e commit 73d19fd
Show file tree
Hide file tree
Showing 23 changed files with 114 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build and Test
# Build and Test the top-level package

name: Build and Test (SwiftPM)
on:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Build and Test
# Build and Test the Xcode App
# This tests the `SwiftProjectTemplateAppPackage` as well as the `SwiftProjectTemplateApp` Xcode project.

name: Build and Test (Xcode)
on:
Expand Down Expand Up @@ -39,17 +40,28 @@ jobs:
- name: Build
run: |
xcrun xcodebuild clean build \
-workspace Xcode/SwiftProjectTemplateApp.xcworkspace \
-workspace .xcode/SwiftProjectTemplate.xcworkspace \
-scheme SwiftProjectTemplateApp \
-derivedDataPath ".build/Xcode.noindex/DerivedData" \
-configuration "${{ matrix.swift-configuration }}" \
-sdk "${{ matrix.xcode-configuration.sdk }}" \
-destination "${{ matrix.xcode-configuration.destination }}"
- name: Test
- name: SwiftPM Tests
if: matrix.swift-configuration == 'debug'
run: |
xcrun xcodebuild test \
-workspace Xcode/SwiftProjectTemplateApp.xcworkspace \
-workspace .xcode/SwiftProjectTemplate.xcworkspace \
-scheme SwiftProjectTemplateAppPackage \
-derivedDataPath ".build/Xcode.noindex/DerivedData" \
-configuration "${{ matrix.swift-configuration }}" \
-sdk "${{ matrix.xcode-configuration.sdk }}" \
-destination "${{ matrix.xcode-configuration.destination }}"
- name: UI Tests
run: |
xcrun xcodebuild test \
-workspace .xcode/SwiftProjectTemplate.xcworkspace \
-scheme SwiftProjectTemplateAppUITests \
-derivedDataPath ".build/Xcode.noindex/DerivedData" \
-configuration "${{ matrix.swift-configuration }}" \
Expand Down
4 changes: 4 additions & 0 deletions .xcode/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Xcode App

This folder contains an Xcode project and Swift Package that together define a multiplatform application built using Xcode.
It is hidden because we includes the top-level package and otherwise there would be an unfortunately recursive folder tree in the Xcode UI.
1 change: 1 addition & 0 deletions .xcode/SwiftProjectTemplate

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1620"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftProjectTemplateAppPackage"
BuildableName = "SwiftProjectTemplateAppPackage"
BlueprintName = "SwiftProjectTemplateAppPackage"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftProjectTemplateAppPackageTests"
BuildableName = "SwiftProjectTemplateAppPackageTests"
BlueprintName = "SwiftProjectTemplateAppPackageTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftProjectTemplateAppPackage"
BuildableName = "SwiftProjectTemplateAppPackage"
BlueprintName = "SwiftProjectTemplateAppPackage"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
)
],
dependencies: [
.package(name: "SwiftProjectTemplate", path: "../..")
.package(name: "SwiftProjectTemplate", path: "../SwiftProjectTemplate")
],
targets: [
.target(
Expand Down
1 change: 1 addition & 0 deletions SwiftProjectTemplate.xcworkspace
7 changes: 7 additions & 0 deletions specialize-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ if [[ -z "${NEW_PROJECT_NAME}" ]]; then
exit 1
fi

# Remove symlinks, as they can't be modified using `sed`
rm SwiftProjectTemplate.xcworkspace .xcode/SwiftProjectTemplate

# `find` returns folders before their children, so this will always rename the parent folder first.
# We re-run `find` every iteration so that the path is correct after renaming a parent folder.
echo "Moving files..."
Expand All @@ -33,6 +36,10 @@ echo "Replacing bundle identifier..."
git ls-files --cached --modified --others --exclude-standard -z |
xargs -0 -I {} sed -i.template-specialization-backup "s/com.github.georgelyon/$NEW_PROJECT_BUNDLE_ID_PREFIX/g" {}

# Re-add symlinks
ln -s ".xcode/${NEW_PROJECT_NAME}.xcworkspace" "${NEW_PROJECT_NAME}.xcworkspace"
(cd .xcode; ln -s .. "${NEW_PROJECT_NAME}")

echo "Removing backup files..."
find . -name '*.template-specialization-backup' -exec rm {} \;
git add -A
Expand Down

0 comments on commit 73d19fd

Please sign in to comment.