Skip to content
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

Add target dependencies to the package manifest via Fix-Its #73745

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,17 @@ namespace swift {
/// The name of the package this module belongs to.
std::string PackageName;

/// The path to the package manifest in which this target resides.
std::string PackageManifestFile;

/// The name of the JSON file containing information about modules
/// that are visible within the package containing this source file.
std::string PackageAvailableModulesFile;

/// The name of this target within its package manifest. This target
/// must be defined in the `PackageManifestFile`.
std::string PackageTargetName;

/// Allow importing a non-package interface from the same package.
bool AllowNonPackageInterfaceImportFromSamePackage = false;

Expand Down
9 changes: 9 additions & 0 deletions include/swift/Option/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,15 @@ def package_name : Separate<["-"], "package-name">,
def export_as : Separate<["-"], "export-as">,
Flags<[FrontendOption, ModuleInterfaceOption]>,
HelpText<"Module name to use when referenced in clients module interfaces">;
def package_available_modules : Separate<["-"], "package-available-modules">,
Flags<[FrontendOption, ArgumentIsPath, DoesNotAffectIncrementalBuild]>,
HelpText<"JSON file describing the modules that are available within the enclosing package">;
def package_manifest : Separate<["-"], "package-manifest">,
Flags<[FrontendOption, ArgumentIsPath, DoesNotAffectIncrementalBuild]>,
HelpText<"The path to the package manifest in which this source file resides">;
def package_target_name : Separate<["-"], "package-target-name">,
Flags<[FrontendOption, DoesNotAffectIncrementalBuild]>,
HelpText<"The name of the target corresponding to this module within the enclosing package">;

def emit_module : Flag<["-"], "emit-module">,
Flags<[FrontendOption, NoInteractiveOption, SupplementaryOutput]>,
Expand Down
1 change: 1 addition & 0 deletions lib/ASTGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_pure_swift_host_library(swiftASTGen STATIC
Sources/ASTGen/LegacyParse.swift
Sources/ASTGen/Literals.swift
Sources/ASTGen/Macros.swift
Sources/ASTGen/PackageAvailableModules.swift
Sources/ASTGen/ParameterClause.swift
Sources/ASTGen/Patterns.swift
Sources/ASTGen/PluginHost.swift
Expand Down
Loading