-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1683 from Skoti/feature/access-level-on-imports
Support access level on import statements
- Loading branch information
Showing
15 changed files
with
293 additions
and
122 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
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
7 changes: 7 additions & 0 deletions
7
PluginExamples/Sources/AccessLevelOnImport/AccessLevelOnImport/AccessLevelOnImport.proto
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,7 @@ | ||
syntax = "proto3"; | ||
|
||
import "Dependency/Dependency.proto"; | ||
|
||
message AccessLevelOnImport { | ||
Dependency dependency = 1; | ||
} |
5 changes: 5 additions & 0 deletions
5
PluginExamples/Sources/AccessLevelOnImport/Dependency/Dependency.proto
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,5 @@ | ||
syntax = "proto3"; | ||
|
||
message Dependency { | ||
string name = 1; | ||
} |
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,3 @@ | ||
/// DO NOT DELETE. | ||
/// | ||
/// We need to keep this file otherwise the plugin is not running. |
12 changes: 12 additions & 0 deletions
12
PluginExamples/Sources/AccessLevelOnImport/swift-protobuf-config.json
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,12 @@ | ||
{ | ||
"invocations": [ | ||
{ | ||
"protoFiles": [ | ||
"AccessLevelOnImport/AccessLevelOnImport.proto", | ||
"Dependency/Dependency.proto", | ||
], | ||
"visibility": "public", | ||
"useAccessLevelOnImports": true | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
PluginExamples/Sources/ExampleTests/AccessLevelOnImportTests.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,13 @@ | ||
#if compiler(>=5.9) | ||
|
||
import AccessLevelOnImport | ||
import XCTest | ||
|
||
final class AccessLevelOnImportTests: XCTestCase { | ||
func testAccessLevelOnImport() { | ||
let access = AccessLevelOnImport.with { $0.dependency = .with { $0.name = "Dependency" } } | ||
XCTAssertEqual(access.dependency.name, "Dependency") | ||
} | ||
} | ||
|
||
#endif |
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
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
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
Oops, something went wrong.