Skip to content
Merged
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
2 changes: 1 addition & 1 deletion DevTools/CollectTests.awk
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ BEGIN {
printf("\n")
printf("import XCTest\n")
printf("@testable import SwiftProtobufTests\n")
printf("@testable import PluginLibraryTests\n")
printf("@testable import SwiftProtobufPluginLibraryTests\n")
printf("\n")
}

Expand Down
2 changes: 1 addition & 1 deletion Documentation/PLUGIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ $ protoc --swift_opt=ProtoPathModuleMappings=[path.asciipb] --swift_out=. foo/ba
```

The format of that mapping file is defined in
[swift_protobuf_module_mappings.proto](../Protos/PluginLibrary/swift_protobuf_module_mappings.proto),
[swift_protobuf_module_mappings.proto](../Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto),
and files would look something like:

```
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ LIBRARY_PROTOS= \
PLUGIN_PROTOS= \
Protos/google/protobuf/compiler/plugin.proto \
Protos/google/protobuf/descriptor.proto \
Protos/PluginLibrary/swift_protobuf_module_mappings.proto
Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto

# Protos that are used by the conformance test runner.
CONFORMANCE_PROTOS= \
Expand Down Expand Up @@ -372,7 +372,7 @@ regenerate: \
regenerate-plugin-protos \
regenerate-test-protos \
regenerate-conformance-protos \
Tests/PluginLibraryTests/DescriptorTestData.swift
Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift

# Rebuild just the protos included in the runtime library
regenerate-library-protos: build ${PROTOC_GEN_SWIFT}
Expand All @@ -387,7 +387,7 @@ regenerate-plugin-protos: build ${PROTOC_GEN_SWIFT}
${GENERATE_SRCS} \
--tfiws_opt=FileNaming=DropPath \
--tfiws_opt=Visibility=Public \
--tfiws_out=Sources/PluginLibrary \
--tfiws_out=Sources/SwiftProtobufPluginLibrary \
${PLUGIN_PROTOS}

# Rebuild just the protos used by the runtime test suite
Expand All @@ -400,7 +400,7 @@ regenerate-test-protos: build ${PROTOC_GEN_SWIFT} Protos/generated_swift_names_e
--tfiws_out=Tests/SwiftProtobufTests \
${TEST_PROTOS}

Tests/PluginLibraryTests/DescriptorTestData.swift: build ${PROTOC_GEN_SWIFT} ${SWIFT_DESCRIPTOR_TEST_PROTOS}
Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift: build ${PROTOC_GEN_SWIFT} ${SWIFT_DESCRIPTOR_TEST_PROTOS}
@${PROTOC} \
--include_imports \
--descriptor_set_out=DescriptorTestData.bin \
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import PackageDescription
let package = Package(
name: "SwiftProtobuf",
targets: [
Target(name: "PluginLibrary",
Target(name: "SwiftProtobufPluginLibrary",
dependencies: ["SwiftProtobuf"]),
Target(name: "protoc-gen-swift",
dependencies: ["PluginLibrary", "SwiftProtobuf"]),
dependencies: ["SwiftProtobufPluginLibrary", "SwiftProtobuf"]),
Target(name: "Conformance",
dependencies: ["SwiftProtobuf"]),
]
Expand Down
9 changes: 5 additions & 4 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ let package = Package(
products: [
.executable(name: "protoc-gen-swift", targets: ["protoc-gen-swift"]),
.library(name: "SwiftProtobuf", type: .static, targets: ["SwiftProtobuf"]),
.library(name: "SwiftProtobufPluginLibrary", targets: ["SwiftProtobufPluginLibrary"]),
],
targets: [
.target(name: "SwiftProtobuf"),
.target(name: "PluginLibrary",
.target(name: "SwiftProtobufPluginLibrary",
dependencies: ["SwiftProtobuf"]),
.target(name: "protoc-gen-swift",
dependencies: ["PluginLibrary", "SwiftProtobuf"]),
dependencies: ["SwiftProtobufPluginLibrary", "SwiftProtobuf"]),
.target(name: "Conformance",
dependencies: ["SwiftProtobuf"]),
.testTarget(name: "SwiftProtobufTests",
dependencies: ["SwiftProtobuf"]),
.testTarget(name: "PluginLibraryTests",
dependencies: ["PluginLibrary"]),
.testTarget(name: "SwiftProtobufPluginLibraryTests",
dependencies: ["SwiftProtobufPluginLibrary"]),
],
swiftLanguageVersions: [3, 4]
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Protos/PluginLibrary/swift_protobuf_module_mappings.proto - Swift Module mappings configuration
// Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto - Swift Module mappings configuration
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion Protos/pluginlib_descriptor_test.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
// -----------------------------------------------------------------------------
///
/// Test proto for Tests/PluginLibraryTests/Test_Descriptor.swift
/// Test proto for Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift
///
// -----------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// DO NOT EDIT.
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: PluginLibrary/swift_protobuf_module_mappings.proto
// Source: SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto
//
// For information on using the generated types, please see the documenation:
// https://github.com/apple/swift-protobuf/

// Protos/PluginLibrary/swift_protobuf_module_mappings.proto - Swift Module mappings configuration
// Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto - Swift Module mappings configuration
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion Reference/pluginlib_descriptor_test.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//
// -----------------------------------------------------------------------------
///
/// Test proto for Tests/PluginLibraryTests/Test_Descriptor.swift
/// Test proto for Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift
///
// -----------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/Array+Extensions.swift - Additions to Arrays
// Sources/SwiftProtobufPluginLibrary/Array+Extensions.swift - Additions to Arrays
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/CodePrinter.swift - Code output
// Sources/SwiftProtobufPluginLibrary/CodePrinter.swift - Code output
//
// Copyright (c) 2014 - 2016 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/Descriptor+Extensions.swift - Additions to Descriptor
// Sources/SwiftProtobufPluginLibrary/Descriptor+Extensions.swift - Additions to Descriptor
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/Descriptor.swift - Descriptor wrappers
// Sources/SwiftProtobufPluginLibrary/Descriptor.swift - Descriptor wrappers
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/FieldNumbers.swift - Proto Field numbers
// Sources/SwiftProtobufPluginLibrary/FieldNumbers.swift - Proto Field numbers
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand All @@ -8,7 +8,7 @@
//
// -----------------------------------------------------------------------------
///
/// Field numbers needed by PluginLibrary since they currently aren't generated.
/// Field numbers needed by SwiftProtobufPluginLibrary since they currently aren't generated.
///
// -----------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/Google_Protobuf_Compiler_CodeGeneratorResponse+Extensions.swift - CodeGeneratorResponse extensions
// Sources/SwiftProtobufPluginLibrary/Google_Protobuf_Compiler_CodeGeneratorResponse+Extensions.swift - CodeGeneratorResponse extensions
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/Google_Protobuf_SourceCodeInfo+Extensions.swift - SourceCodeInfo Additions
// Sources/SwiftProtobufPluginLibrary/Google_Protobuf_SourceCodeInfo+Extensions.swift - SourceCodeInfo Additions
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/HashableArray.swift - Wrapper array to support hashing
// Sources/SwiftProtobufPluginLibrary/HashableArray.swift - Wrapper array to support hashing
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/NamingUtils.swift - Utilities for generating names
// Sources/SwiftProtobufPluginLibrary/NamingUtils.swift - Utilities for generating names
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/ProtoPathModuleMappings.swift - Helpers for module mappings option
// Sources/SwiftProtobufPluginLibrary/ProtoPathModuleMappings.swift - Helpers for module mappings option
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/ProvidesLocationPath.swift - Proto Field numbers
// Sources/SwiftProtobufPluginLibrary/ProvidesLocationPath.swift - Proto Field numbers
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/ProvidesSourceCodeLocation.swift - SourceCodeInfo.Location provider
// Sources/SwiftProtobufPluginLibrary/ProvidesSourceCodeLocation.swift - SourceCodeInfo.Location provider
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/SwiftLanguage.swift - Swift language utilities
// Sources/SwiftProtobufPluginLibrary/SwiftLanguage.swift - Swift language utilities
//
// Copyright (c) 2014 - 2016 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/LibraryInfo.swift - Helpers info about the SwiftProtobuf library
// Sources/SwiftProtobufPluginLibrary/LibraryInfo.swift - Helpers info about the SwiftProtobuf library
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/SwiftProtobufNamer.swift - A helper that generates SwiftProtobuf names.
// Sources/SwiftProtobufPluginLibrary/SwiftProtobufNamer.swift - A helper that generates SwiftProtobuf names.
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Sources/PluginLibrary/UnicodeScalar+Extensions.swift - Utilities for working with UnicodeScalars
// Sources/SwiftProtobufPluginLibrary/UnicodeScalar+Extensions.swift - Utilities for working with UnicodeScalars
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// DO NOT EDIT.
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: PluginLibrary/swift_protobuf_module_mappings.proto
// Source: SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto
//
// For information on using the generated types, please see the documenation:
// https://github.com/apple/swift-protobuf/

// Protos/PluginLibrary/swift_protobuf_module_mappings.proto - Swift Module mappings configuration
// Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto - Swift Module mappings configuration
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/Descriptor+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// -----------------------------------------------------------------------------

import PluginLibrary
import SwiftProtobufPluginLibrary

extension FileDescriptor {
/// True if this file should perserve unknown enums within the enum.
Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/EnumGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// -----------------------------------------------------------------------------

import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf

/// The name of the case used to represent unrecognized values in proto3.
Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/ExtensionSetGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
///
// -----------------------------------------------------------------------------
import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf

/// Provides the generation for proto2 syntax extensions in a file.
Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/FieldGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// -----------------------------------------------------------------------------

import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf


Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/FileGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
///
// -----------------------------------------------------------------------------
import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf


Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/GeneratorOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// -----------------------------------------------------------------------------

import PluginLibrary
import SwiftProtobufPluginLibrary

class GeneratorOptions {
enum OutputNaming : String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// -----------------------------------------------------------------------------

import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf

extension Google_Protobuf_DescriptorProto.ExtensionRange {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
///
// -----------------------------------------------------------------------------

import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf

extension Google_Protobuf_FileDescriptorProto {
Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/MessageFieldGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
///
// -----------------------------------------------------------------------------
import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf


Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/MessageGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// -----------------------------------------------------------------------------

import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf

class MessageGenerator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// -----------------------------------------------------------------------------

import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf

/// Generates the `_StorageClass` used for messages that employ copy-on-write
Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/OneofGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
///
// -----------------------------------------------------------------------------
import Foundation
import PluginLibrary
import SwiftProtobufPluginLibrary
import SwiftProtobuf

class OneofGenerator {
Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-swift/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import Foundation
import SwiftProtobuf
import PluginLibrary
import SwiftProtobufPluginLibrary

extension Google_Protobuf_Compiler_Version {
fileprivate var versionString: String {
Expand Down
2 changes: 1 addition & 1 deletion Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import XCTest
@testable import SwiftProtobufTests
@testable import PluginLibraryTests
@testable import SwiftProtobufPluginLibraryTests


extension Test_Descriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// -----------------------------------------------------------------------------

import PluginLibrary
import SwiftProtobufPluginLibrary

extension Google_Protobuf_FileDescriptorProto {
init(name: String, dependencies: [String] = [], publicDependencies: [Int32] = []) {
Expand Down
Loading