Skip to content

Commit bb37e33

Browse files
fwcdahoppen
authored andcommitted
Move examples to snippets
1 parent 54e4440 commit bb37e33

File tree

7 files changed

+5
-44
lines changed

7 files changed

+5
-44
lines changed

Examples/Package.swift

Lines changed: 0 additions & 36 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ text editor, or IDE.
8787
- [SwiftParser](Sources/SwiftParser/SwiftParser.docc)
8888
- [SwiftOperators](Sources/SwiftOperators/SwiftOperators.docc)
8989

90+
Examples of how to use SwiftSyntax can be found in [Snippets](Snippets).
91+
9092
## Contributing
9193

9294
Start contributing to SwiftSyntax see [this guide](CONTRIBUTING.md) for more information.
File renamed without changes.

Examples/README.md renamed to Snippets/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Examples
1+
# Snippets (Examples)
22

33
Each example can be executed by navigating into this folder and running `swift run <example> <arguments>`. There is the following set of examples available:
44

build-script.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
PACKAGE_DIR = os.path.dirname(os.path.realpath(__file__))
1717
WORKSPACE_DIR = os.path.dirname(PACKAGE_DIR)
18-
EXAMPLES_DIR = os.path.join(PACKAGE_DIR, "Examples")
1918
SOURCES_DIR = os.path.join(PACKAGE_DIR, "Sources")
2019
IDEUTILS_DIR = os.path.join(SOURCES_DIR, "IDEUtils")
2120
SWIFTSYNTAX_DIR = os.path.join(SOURCES_DIR, "SwiftSyntax")
@@ -464,10 +463,6 @@ def buildProduct(self, product_name: str) -> None:
464463
print("** Building product " + product_name + " **")
465464
self.__build(PACKAGE_DIR, product_name)
466465

467-
def buildExample(self, example_name: str) -> None:
468-
print("** Building example " + example_name + " **")
469-
self.__build(EXAMPLES_DIR, example_name)
470-
471466
def __build(self, package_dir: str, product_name: str) -> None:
472467
command = list(self.__get_swiftpm_invocation(package_dir))
473468
command.extend(["--product", product_name])
@@ -764,8 +759,8 @@ def build_command(args: argparse.Namespace) -> None:
764759
builder.buildProduct("SwiftSyntaxBuilder")
765760

766761
# Build examples
767-
builder.buildExample("AddOneToIntegerLiterals")
768-
builder.buildExample("CodeGenerationUsingSwiftSyntaxBuilder")
762+
builder.buildProduct("AddOneToIntegerLiterals")
763+
builder.buildProduct("CodeGenerationUsingSwiftSyntaxBuilder")
769764
except subprocess.CalledProcessError as e:
770765
fail_for_called_process_error("Building SwiftSyntax failed", e)
771766

0 commit comments

Comments
 (0)