forked from swiftlang/swift-package-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
[GSoC] SwiftPM PR #1
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
Open
stevapple
wants to merge
23
commits into
main
Choose a base branch
from
gsoc-2021
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
06f36e3
Simple package attribute parser
stevapple 36180cc
Enhance package-parser
stevapple 0e50e43
Introduce swift-script
stevapple d2f747e
Add some more commands
stevapple 027bdc5
Minor bugfix
stevapple e117920
Fix CMake build
stevapple 195db6c
Add functionality to swift-script
stevapple 7a937c7
Minor fixes
stevapple 811f887
Fix typo
stevapple 29e7e41
Rearrange arguments
stevapple b582478
Minor fixes
stevapple 22e5601
Minor fixes
stevapple d82b0c7
Separate package-parser
stevapple a6eab23
Fix building
stevapple c6192bf
Update tool name
stevapple 847b584
Toolchain support
stevapple 67e494c
Update ScriptingCore to keep up with package-syntax-parser
stevapple 3a7490b
Add document and comments
stevapple 9baf376
improve ScriptingCore
stevapple 934eea4
Add tests for swift-script
stevapple edd3056
Fix cache checking bug
stevapple ee778d9
Use SCRIPT_DIR placeholder in fixtures
stevapple 13ac151
Fix symlink resolution
stevapple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
let arguments = CommandLine.arguments.dropFirst() | ||
print(arguments.map{"\"\($0)\""}.joined(separator: " ")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"dependencies" : [ | ||
|
||
], | ||
"sourceFile" : "SCRIPT_DIR\/EchoArguments.swift" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@package(name: "CwdDump", path: "cwd-dump") | ||
import CwdDump | ||
|
||
CwdDump.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"dependencies" : [ | ||
{ | ||
"package" : { | ||
"raw" : "name:\"CwdDump\",path:\"SCRIPT_DIR\/cwd-dump\"", | ||
"path" : "SCRIPT_DIR\/cwd-dump", | ||
"name" : "CwdDump" | ||
}, | ||
"modules" : [ | ||
"CwdDump" | ||
] | ||
} | ||
], | ||
"sourceFile" : "SCRIPT_DIR\/EchoCWD.swift" | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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: "CwdDump", | ||
products: [ | ||
// Products define the executables and libraries a package produces, and make them visible to other packages. | ||
.library( | ||
name: "CwdDump", | ||
targets: ["CwdDump"]) | ||
], | ||
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: "CwdDump") | ||
] | ||
) |
7 changes: 7 additions & 0 deletions
7
Fixtures/Scripts/EchoCWD/cwd-dump/Sources/CwdDump/CwdDump.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Foundation | ||
|
||
public struct CwdDump { | ||
public static func main() { | ||
print(FileManager().currentDirectoryPath) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this instead just call
getOrCreateSwiftPMCacheDirectory()
and then append thescripts
subdirectory to it? Otherwise this function seems to duplicate some of the existing code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ummm... In fact the
scripts
dir is supposed to be besidecache
, which I'm afraid may "escape" if we simply append../scripts
to the cache dir (also, we need to create it if there's none, which needs a function to wrap up).I thought it may be better to hardcode the path with
~/.swiftpm/scripts
to make it more accessible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense — I'm not 100% familiar with how the layout is supposed to look here, it just seemed as if there was some code overlap here.