SPM support

This commit is contained in:
Matt
2022-11-02 09:50:51 -04:00
committed by Michael Hoffmann
parent 45ce22c16e
commit 99298c8ace
3 changed files with 56 additions and 0 deletions

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ npm-debug.log
log.html
.env
.DS_Store
/.build

39
Package.swift Normal file
View File

@@ -0,0 +1,39 @@
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "TreeSitterHCL",
platforms: [.macOS(.v10_13), .iOS(.v11)],
products: [
.library(name: "TreeSitterHCL", targets: ["TreeSitterHCL"]),
],
dependencies: [],
targets: [
.target(name: "TreeSitterHCL",
path: ".",
exclude: [
"binding.gyp",
"bindings",
"Cargo.toml",
"CHANGELOG.md",
"docs",
"example",
"grammar.js",
"LICENSE",
"package.json",
"README.md",
"shell.nix",
"src/grammar.json",
"src/node-types.json",
"test",
],
sources: [
"src/parser.c",
"src/scanner.cc",
],
publicHeadersPath: "bindings/swift",
cSettings: [.headerSearchPath("src")],
linkerSettings: [.linkedLibrary("c++")])
]
)

View File

@@ -0,0 +1,16 @@
#ifndef TREE_SITTER_HCL_H_
#define TREE_SITTER_HCL_H_
typedef struct TSLanguage TSLanguage;
#ifdef __cplusplus
extern "C" {
#endif
extern TSLanguage *tree_sitter_hcl();
#ifdef __cplusplus
}
#endif
#endif // TREE_SITTER_HCL_H_