Skip to content

SE-0318 Package creation #3514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Fixtures/Templates/AddTemplate/GoodTemplate/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "___NAME___",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "___NAME___",
targets: ["___NAME___"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "___NAME___",
dependencies: [],
path: "Sources/___NAME___"),
.testTarget(
name: "___NAME___Tests",
dependencies: ["___NAME___"],
path: "Tests/___NAME___Tests"),
]
)
3 changes: 3 additions & 0 deletions Fixtures/Templates/AddTemplate/GoodTemplate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ___NAME___

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public struct ___NAME_AS_C99___ {
public private(set) var text = "Hello, World!"

public init() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import XCTest
@testable import ___NAME_AS_C99___

final class ___NAME_AS_C99___Tests: XCTestCase {
func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(___NAME_AS_C99___().text, "Hello, World!")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ___NAME___

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public struct ___NAME_AS_C99___ {
public private(set) var text = "Hello, World!"

public init() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import XCTest
@testable import ___NAME_AS_C99___

final class ___NAME_AS_C99___Tests: XCTestCase {
func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(___NAME_AS_C99___().text, "Hello, World!")
}
}
30 changes: 30 additions & 0 deletions Fixtures/Templates/AddTemplateErrors/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "___NAME___",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "___NAME___",
targets: ["___NAME___"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "___NAME___",
dependencies: [],
path: "Sources/___NAME___"),
.testTarget(
name: "___NAME___Tests",
dependencies: ["___NAME___"],
path: "Tests/___NAME___Tests"),
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "___NAME___",
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.executableTarget(
name: "___NAME___",
dependencies: [],
path: "src"),
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ___NAME___

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hello, world!")
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "___NAME___",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "___NAME___",
targets: ["___NAME___"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "___NAME___",
dependencies: [],
path: "Sources"),
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# LibTemplate

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public struct ___NAME_AS_C99___ {
public private(set) var text = "Hello, World!"

public init() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "___NAME___",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "___NAME___",
targets: ["___NAME___"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "___NAME___",
dependencies: [],
path: "Sources"),
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ___NAME___

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public struct ___NAME_AS_C99___ {
public private(set) var text = "Hello, World!"

public init() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "___NAME___",
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.executableTarget(
name: "___NAME___",
dependencies: [],
path: "src"),
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hello, world!")
Loading