-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start using a local package for SPM dependecies, add clojure support #20
- Loading branch information
1 parent
7556492
commit c4dd226
Showing
13 changed files
with
135 additions
and
193 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,3 +1 @@ | ||
#include "Configurations/Edit.xcconfig" | ||
|
||
OTHER_LDFLAGS[config=Debug] = -ObjC -fprofile-instr-generate |
This file contains 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 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 |
---|---|---|
@@ -1,6 +1,15 @@ | ||
// This is a workaround for a ridiculous problem related to non-Swift SPM dependencies. However, the linker will be unhappy if these modulemap files don't exist. So dependency management can get a little tricky. | ||
// - "Internal" is for TextStory | ||
// - "tree-sitter" is for SwiftTreeSitter | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/Internal.modulemap -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/tree-sitter.modulemap -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterGo.modulemap -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterMarkdown.modulemap -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterMarkdownInline.modulemap -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterOCaml.modulemap -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterSwift.modulemap | ||
// This is necessary because the static libraries that depend on these modules do not link to them. If they did, they would all build, but EditKit would fail because it needs to use -all_load, and Xcode incorrectly links SPM packages twice. FB14262567 | ||
|
||
// TextStory | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/Internal.modulemap | ||
|
||
// SwiftTreeSitter | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/tree-sitter.modulemap | ||
|
||
// All the tree-sitter parsers | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterClojure.modulemap | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterGo.modulemap | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterMarkdown.modulemap | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterMarkdownInline.modulemap | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterOCaml.modulemap | ||
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterSwift.modulemap |
This file was deleted.
Oops, something went wrong.
This file contains 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,8 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc |
This file contains 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,33 @@ | ||
// swift-tools-version: 5.10 | ||
|
||
import PackageDescription | ||
|
||
// This package defines all of the SPM dependencies for the project. It is used as an alternative to the Xcode SPM dependency editor. | ||
// I have not yet migrated everything in here. | ||
|
||
let package = Package( | ||
name: "Dependencies", | ||
products: [ | ||
// I don't think many dependencies will need to use this same approach. | ||
.library(name: "TreeSitterParsers", targets: ["TreeSitterParsers"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/mattmassicotte/tree-sitter-clojure", branch: "feature/spm"), | ||
.package(url: "https://github.com/tree-sitter/tree-sitter-go", branch: "master"), | ||
.package(url: "https://github.com/tree-sitter-grammars/tree-sitter-markdown", branch: "split_parser"), | ||
.package(url: "https://github.com/tree-sitter/tree-sitter-ocaml", branch: "master"), | ||
.package(url: "https://github.com/alex-pinkus/tree-sitter-swift", branch: "with-generated-files"), | ||
], | ||
targets: [ | ||
.target( | ||
name: "TreeSitterParsers", | ||
dependencies: [ | ||
.product(name: "TreeSitterClojure", package: "tree-sitter-clojure"), | ||
.product(name: "TreeSitterGo", package: "tree-sitter-go"), | ||
.product(name: "TreeSitterMarkdown", package: "tree-sitter-markdown"), | ||
.product(name: "TreeSitterOCaml", package: "tree-sitter-ocaml"), | ||
.product(name: "TreeSitterSwift", package: "tree-sitter-swift"), | ||
] | ||
), | ||
] | ||
) |
6 changes: 6 additions & 0 deletions
6
Dependencies/Sources/TreeSitterParsers/TreeSitterParsers.swift
This file contains 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 @@ | ||
@_exported import TreeSitterClojure | ||
@_exported import TreeSitterGo | ||
@_exported import TreeSitterMarkdown | ||
@_exported import TreeSitterMarkdownInline | ||
@_exported import TreeSitterOCaml | ||
@_exported import TreeSitterSwift |
Oops, something went wrong.