Skip to content

Commit

Permalink
Adding simple multiplatform fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
waltflanagan committed Oct 10, 2023
1 parent 5d960ba commit a9621b5
Show file tree
Hide file tree
Showing 19 changed files with 371 additions and 0 deletions.
63 changes: 63 additions & 0 deletions projects/tuist/fixtures/multiplatform_app_with_sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Xcode ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno

### Projects ###
*.xcodeproj
*.xcworkspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import SwiftUI

@main
struct TuistApp: App {
var body: some Scene {
WindowGroup {
Text("Tuist is great")
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import CloudKit
import SQLite3

public class FrameworkClass {
public init() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import ProjectDescription

let project = Project(
name: "StaticFramework",
targets: [
Target(
name: "StaticFramework",
platform: .iOS,
product: .staticFramework,
bundleId: "io.tuist.StaticFramework",
infoPlist: "Support/Info.plist",
sources: ["Sources/**"],
headers: .headers(public: "Sources/**/*.h"),
dependencies: [
.sdk(name: "c++", type: .library),
]
),
Target(
name: "StaticFrameworkTests",
platform: .iOS,
product: .unitTests,
bundleId: "io.tuist.StaticFrameworkTests",
infoPlist: "Support/Tests.plist",
sources: "Tests/**",
dependencies: [
.target(name: "StaticFramework"),
]
),
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class FrameworkClass {
func something() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface MyObjcppClass : NSObject
- (void)hello;
@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import "MyObjcppClass.h"

#include <iostream>

@implementation MyObjcppClass

- (void)hello
{
std::cout << "Hello from cpp" << std::endl;
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef StaticFramework_h
#define StaticFramework_h

#import <StaticFramework/MyObjcppClass.h>

#endif /* StaticFramework_h */
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright ©. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright ©. All rights reserved.</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Foundation
import XCTest

@testable import StaticFramework

final class MyObjcppClassTests: XCTestCase {
func testHello() {
XCTAssertNotNil(MyObjcppClass())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import XCTest

public class MyTestHelper {
public init() {}

public func customAssert(_: Bool, file _: StaticString = #file, line _: Int = #line) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import Foundation
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='ios'>
<timeline fileName='timeline.xctimeline'/>
</playground>
57 changes: 57 additions & 0 deletions projects/tuist/fixtures/multiplatform_app_with_sdk/Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import ProjectDescription

let project = Project(
name: "Project",
targets: [
Target(
name: "MyTestFramework",
platform: .iOS,
product: .framework,
bundleId: "io.tuist.MyTestFramework",
infoPlist: .default,
sources: "MyTestFramework/**",
dependencies: [
.xctest,
]
),
Target(
name: "AppTests",
platform: .iOS,
product: .unitTests,
bundleId: "io.tuist.AppTests",
infoPlist: "Support/Tests.plist",
sources: "Tests/**",
dependencies: [
.target(name: "App"),
.target(name: "MyTestFramework"),
]
),
],
multiplatformTargets: [
Multiplatform.Target(
name: "App",
destinations: [.iPhone, .iPad, .mac],
product: .app,
bundleId: "io.tuist.App",
infoPlist: "Support/App-Info.plist",
sources: "App/**",
dependencies: [
.sdk(name: "CloudKit", type: .framework, status: .required),
.sdk(name: "ARKit", type: .framework, status: .required),
.sdk(name: "MobileCoreServices", type: .framework, status: .required),
]
),
Multiplatform.Target(
name: "MultiPlatformFramework",
destinations: [.iPad, .iPhone, .mac, .appleTv],
product: .framework,
bundleId: "io.tuist.MacFramework",
infoPlist: "Support/Framework-Info.plist",
sources: "Framework/**",
dependencies: [
.sdk(name: "CloudKit", type: .framework, status: .optional),
.sdk(name: "sqlite3", type: .library),
]
),
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright ©. All rights reserved.</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright Tuist©. All rights reserved.</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright ©. All rights reserved.</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Foundation
import MyTestFramework
import XCTest

@testable import App

final class AppTests: XCTestCase {
private let helper = MyTestHelper()
func test_foo() {
helper.customAssert(true)
}
}

0 comments on commit a9621b5

Please sign in to comment.