Skip to content

Commit

Permalink
Add CreateFile task
Browse files Browse the repository at this point in the history
  • Loading branch information
fortmarek committed Sep 15, 2021
1 parent 6d9c4f5 commit 2bcd5e8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/**
Tasks/.build
Tasks/.swiftpm
21 changes: 21 additions & 0 deletions Tasks/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "LocalPlugin",
products: [
.executable(
name: "create-file",
targets: ["CreateFile"]
),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
.target(name: "CreateFile"),
]
)
8 changes: 8 additions & 0 deletions Tasks/Sources/CreateFile/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Foundation

try "File created with a plugin".write(
to: URL(fileURLWithPath: "plugin-file.txt"),
atomically: true,
encoding: .utf8
)
print("File created with a plugin!")

0 comments on commit 2bcd5e8

Please sign in to comment.