Skip to content

Commit f76d4d4

Browse files
committed
Update structure of the package to align more closely with standard SwiftPM packages
Most importantly, move the source files from `lib` to `Sources` and remove the need for most symlinks.
1 parent b610e66 commit f76d4d4

File tree

307 files changed

+1160
-1177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+1160
-1177
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ find_package(LMDB CONFIG)
1717

1818
include(SwiftSupport)
1919

20-
add_subdirectory(lib)
2120
add_subdirectory(Sources)
2221
add_subdirectory(cmake/modules)

Package.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ let package = Package(
8686
.target(
8787
name: "IndexStoreDB_Index",
8888
dependencies: ["IndexStoreDB_Database"],
89-
path: "lib/Index",
9089
exclude: [
9190
"CMakeLists.txt",
9291
"indexstore_functions.def",
@@ -96,7 +95,6 @@ let package = Package(
9695
.target(
9796
name: "IndexStoreDB_CIndexStoreDB",
9897
dependencies: ["IndexStoreDB_Index"],
99-
path: "lib/CIndexStoreDB",
10098
exclude: ["CMakeLists.txt"]),
10199

102100
// The lmdb database layer.
@@ -106,7 +104,6 @@ let package = Package(
106104
"IndexStoreDB_Core",
107105
.product(name: "CLMDB", package: "swift-lmdb"),
108106
],
109-
path: "lib/Database",
110107
exclude: [
111108
"CMakeLists.txt",
112109
]),
@@ -115,21 +112,18 @@ let package = Package(
115112
.target(
116113
name: "IndexStoreDB_Core",
117114
dependencies: ["IndexStoreDB_Support"],
118-
path: "lib/Core",
119115
exclude: ["CMakeLists.txt"]),
120116

121117
// Support code that is generally useful to the C++ implementation.
122118
.target(
123119
name: "IndexStoreDB_Support",
124120
dependencies: ["IndexStoreDB_LLVMSupport"],
125-
path: "lib/Support",
126121
exclude: ["CMakeLists.txt"]),
127122

128123
// Copy of a subset of llvm's ADT and Support libraries.
129124
.target(
130125
name: "IndexStoreDB_LLVMSupport",
131126
dependencies: [],
132-
path: "lib/LLVMSupport",
133127
exclude: [
134128
"LICENSE.TXT",
135129
"CMakeLists.txt",

Sources/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
add_subdirectory(IndexStoreDB_LLVMSupport)
2+
add_subdirectory(IndexStoreDB_Support)
3+
add_subdirectory(IndexStoreDB_Core)
4+
add_subdirectory(IndexStoreDB_Database)
5+
add_subdirectory(IndexStoreDB_Index)
6+
add_subdirectory(IndexStoreDB_CIndexStoreDB)
17
add_subdirectory(IndexStoreDB)

Sources/IndexStoreDB/IndexDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import CIndexStoreDB
13+
@_implementationOnly import IndexStoreDB_CIndexStoreDB
1414

1515
public struct StoreUnitInfo {
1616
public let mainFilePath: String

Sources/IndexStoreDB/IndexStoreDB.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@_implementationOnly
14-
import CIndexStoreDB
14+
import IndexStoreDB_CIndexStoreDB
1515
import Foundation
1616

1717
// For `strdup`

Sources/IndexStoreDB/IndexStoreDBError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@_implementationOnly
14-
import CIndexStoreDB
14+
import IndexStoreDB_CIndexStoreDB
1515

1616
import protocol Foundation.LocalizedError
1717

Sources/IndexStoreDB/Symbol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@_implementationOnly
14-
import CIndexStoreDB
14+
import IndexStoreDB_CIndexStoreDB
1515

1616
public enum IndexSymbolKind: Hashable, Sendable {
1717
case unknown

Sources/IndexStoreDB/SymbolLocation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@_implementationOnly
14-
import CIndexStoreDB
14+
import IndexStoreDB_CIndexStoreDB
1515
import Foundation
1616

1717
public struct SymbolLocation: Equatable, Sendable {

Sources/IndexStoreDB/SymbolOccurrence.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@_implementationOnly
14-
import CIndexStoreDB
14+
import IndexStoreDB_CIndexStoreDB
1515

1616
public struct SymbolOccurrence: Equatable {
1717
public var symbol: Symbol

Sources/IndexStoreDB/SymbolProperty.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@_implementationOnly
14-
import CIndexStoreDB
14+
import IndexStoreDB_CIndexStoreDB
1515

1616
public struct SymbolProperty: OptionSet, Hashable, Sendable {
1717
public var rawValue: UInt64

Sources/IndexStoreDB/SymbolRole.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@_implementationOnly
14-
import CIndexStoreDB
14+
import IndexStoreDB_CIndexStoreDB
1515

1616
public struct SymbolRole: OptionSet, Hashable, Sendable {
1717

lib/CIndexStoreDB/CIndexStoreDB.cpp renamed to Sources/IndexStoreDB_CIndexStoreDB/CIndexStoreDB.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "CIndexStoreDB/CIndexStoreDB.h"
14-
#include "CIndexStoreDB/CIndexStoreDB_Internal.h"
15-
#include "IndexStoreDB/Index/IndexStoreLibraryProvider.h"
16-
#include "IndexStoreDB/Index/IndexSystem.h"
17-
#include "IndexStoreDB/Index/IndexSystemDelegate.h"
18-
#include "IndexStoreDB/Support/Path.h"
19-
#include "IndexStoreDB/Core/Symbol.h"
20-
#include "indexstore/IndexStoreCXX.h"
21-
#include "llvm/ADT/IntrusiveRefCntPtr.h"
13+
#include <IndexStoreDB_CIndexStoreDB/CIndexStoreDB.h>
14+
#include <IndexStoreDB_CIndexStoreDB/CIndexStoreDB_Internal.h>
15+
#include <IndexStoreDB_Index/IndexStoreLibraryProvider.h>
16+
#include <IndexStoreDB_Index/IndexSystem.h>
17+
#include <IndexStoreDB_Index/IndexSystemDelegate.h>
18+
#include <IndexStoreDB_Support/Path.h>
19+
#include <IndexStoreDB_Core/Symbol.h>
20+
#include <IndexStoreDB_Index/IndexStoreCXX.h>
21+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_IntrusiveRefCntPtr.h>
2222
#include <Block.h>
2323

2424
using namespace IndexStoreDB;

lib/CIndexStoreDB/CMakeLists.txt renamed to Sources/IndexStoreDB_CIndexStoreDB/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ add_library(CIndexStoreDB STATIC
33
target_compile_options(CIndexStoreDB PRIVATE
44
-fblocks)
55
target_include_directories(CIndexStoreDB PUBLIC
6-
${PROJECT_SOURCE_DIR}/include/CIndexStoreDB)
6+
include)
77
target_link_libraries(CIndexStoreDB PRIVATE
8-
LLVMSupport)
9-
target_link_libraries(CIndexStoreDB PUBLIC
108
Index)
119
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
1210
target_link_libraries(CIndexStoreDB PRIVATE

include/CIndexStoreDB/CIndexStoreDB.h renamed to Sources/IndexStoreDB_CIndexStoreDB/include/IndexStoreDB_CIndexStoreDB/CIndexStoreDB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef INDEXSTOREDB_INDEX_H
1414
#define INDEXSTOREDB_INDEX_H
1515

16-
#include "indexstore/indexstore_functions.h"
16+
#include <IndexStoreDB_CIndexStoreDB/indexstore_functions.h>
1717
#include <stdint.h>
1818
#include <stdbool.h>
1919

include/CIndexStoreDB/CIndexStoreDB_Internal.h renamed to Sources/IndexStoreDB_CIndexStoreDB/include/IndexStoreDB_CIndexStoreDB/CIndexStoreDB_Internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef INDEXSTOREDB_INTERNAL_H
1414
#define INDEXSTOREDB_INTERNAL_H
1515

16-
#include "llvm/ADT/IntrusiveRefCntPtr.h"
16+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_IntrusiveRefCntPtr.h>
1717
#include <utility>
1818

1919
namespace IndexStoreDB {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../IndexStoreDB_Index/include/IndexStoreDB_Index/indexstore_functions.h
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module IndexStoreDB_CIndexStoreDB {
2+
header "IndexStoreDB_CIndexStoreDB/CIndexStoreDB.h"
3+
header "IndexStoreDB_CIndexStoreDB/indexstore_functions.h"
4+
}

lib/Core/CMakeLists.txt renamed to Sources/IndexStoreDB_Core/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
add_library(Core STATIC
22
Symbol.cpp)
3-
target_include_directories(Core PRIVATE
3+
target_include_directories(Core PUBLIC
44
include)
5-
target_link_libraries(Core PRIVATE
6-
Support
7-
LLVMSupport)
5+
target_link_libraries(Core PUBLIC
6+
Support)
87

98
if(NOT BUILD_SHARED_LIBS)
109
set_property(GLOBAL APPEND PROPERTY IndexStoreDB_EXPORTS Core)

lib/Core/Symbol.cpp renamed to Sources/IndexStoreDB_Core/Symbol.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "IndexStoreDB/Core/Symbol.h"
14-
#include "llvm/ADT/STLExtras.h"
15-
#include "llvm/ADT/StringSwitch.h"
16-
#include "llvm/Support/ErrorHandling.h"
17-
#include "llvm/Support/raw_ostream.h"
13+
#include <IndexStoreDB_Core/Symbol.h>
14+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_STLExtras.h>
15+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_StringSwitch.h>
16+
#include <IndexStoreDB_LLVMSupport/llvm_Support_ErrorHandling.h>
17+
#include <IndexStoreDB_LLVMSupport/llvm_Support_raw_ostream.h>
1818

1919
using namespace IndexStoreDB;
2020

include/IndexStoreDB/Core/Symbol.h renamed to Sources/IndexStoreDB_Core/include/IndexStoreDB_Core/Symbol.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
#ifndef INDEXSTOREDB_CORE_SYMBOL_H
1616
#define INDEXSTOREDB_CORE_SYMBOL_H
1717

18-
#include "IndexStoreDB/Support/LLVM.h"
19-
#include "IndexStoreDB/Support/Path.h"
20-
#include "llvm/ADT/ArrayRef.h"
21-
#include "llvm/ADT/Optional.h"
22-
#include "llvm/ADT/OptionSet.h"
23-
#include "llvm/ADT/StringRef.h"
24-
#include "llvm/ADT/SmallVector.h"
25-
#include "llvm/Support/DataTypes.h"
26-
#include "llvm/Support/Chrono.h"
18+
#include <IndexStoreDB_Support/LLVM.h>
19+
#include <IndexStoreDB_Support/Path.h>
20+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_ArrayRef.h>
21+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_Optional.h>
22+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_OptionSet.h>
23+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_StringRef.h>
24+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_SmallVector.h>
25+
#include <IndexStoreDB_LLVMSupport/llvm_Support_DataTypes.h>
26+
#include <IndexStoreDB_LLVMSupport/llvm_Support_Chrono.h>
2727
#include <memory>
2828
#include <string>
2929

lib/Database/CMakeLists.txt renamed to Sources/IndexStoreDB_Database/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ target_compile_definitions(Database PRIVATE
88
_CRT_SECURE_NO_WARNINGS)
99
target_compile_options(Database PRIVATE
1010
-fblocks)
11-
target_include_directories(Database PRIVATE
11+
target_include_directories(Database PUBLIC
1212
include)
13-
target_link_libraries(Database PRIVATE
14-
LMDB::CLMDB
13+
target_link_libraries(Database PUBLIC
1514
Core
16-
LLVMSupport)
15+
LLVMSupport
16+
Support)
17+
target_link_libraries(Database PRIVATE
18+
LMDB::CLMDB)
1719
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
1820
target_link_libraries(Database PRIVATE
1921
dispatch)

lib/Database/Database.cpp renamed to Sources/IndexStoreDB_Database/Database.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "DatabaseImpl.h"
14-
#include "IndexStoreDB/Core/Symbol.h"
15-
#include "IndexStoreDB/Database/UnitInfo.h"
16-
#include "IndexStoreDB/Support/Logging.h"
17-
#include "IndexStoreDB/Support/Path.h"
18-
#include "llvm/ADT/Hashing.h"
19-
#include "llvm/ADT/StringRef.h"
20-
#include "llvm/ADT/StringMap.h"
21-
#include "llvm/ADT/STLExtras.h"
22-
#include "llvm/Support/Errc.h"
23-
#include "llvm/Support/FileSystem.h"
24-
#include "llvm/Support/Mutex.h"
25-
#include "llvm/Support/Path.h"
26-
#include "llvm/Support/raw_ostream.h"
27-
#include "llvm/Support/WindowsError.h"
14+
#include <IndexStoreDB_Core/Symbol.h>
15+
#include <IndexStoreDB_Database/UnitInfo.h>
16+
#include <IndexStoreDB_Support/Logging.h>
17+
#include <IndexStoreDB_Support/Path.h>
18+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_Hashing.h>
19+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_StringRef.h>
20+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_StringMap.h>
21+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_STLExtras.h>
22+
#include <IndexStoreDB_LLVMSupport/llvm_Support_Errc.h>
23+
#include <IndexStoreDB_LLVMSupport/llvm_Support_FileSystem.h>
24+
#include <IndexStoreDB_LLVMSupport/llvm_Support_Mutex.h>
25+
#include <IndexStoreDB_LLVMSupport/llvm_Support_Path.h>
26+
#include <IndexStoreDB_LLVMSupport/llvm_Support_raw_ostream.h>
27+
#include <IndexStoreDB_LLVMSupport/llvm_Support_WindowsError.h>
2828
#if defined(_WIN32)
2929
#define NOMINMAX
3030
#include "Windows.h"

lib/Database/DatabaseError.cpp renamed to Sources/IndexStoreDB_Database/DatabaseError.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "IndexStoreDB/Database/DatabaseError.h"
13+
#include <IndexStoreDB_Database/DatabaseError.h>
1414
#include "lmdb/lmdb++.h"
15-
#include "llvm/Support/raw_ostream.h"
15+
#include <IndexStoreDB_LLVMSupport/llvm_Support_raw_ostream.h>
1616

1717
using namespace IndexStoreDB;
1818
using namespace IndexStoreDB::db;

lib/Database/DatabaseImpl.h renamed to Sources/IndexStoreDB_Database/DatabaseImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef INDEXSTOREDB_SKDATABASE_LIB_DATABASEIMPL_H
1414
#define INDEXSTOREDB_SKDATABASE_LIB_DATABASEIMPL_H
1515

16-
#include "IndexStoreDB/Database/Database.h"
16+
#include <IndexStoreDB_Database/Database.h>
1717
#include "lmdb/lmdb++.h"
1818
#include <dispatch/dispatch.h>
1919

lib/Database/ImportTransaction.cpp renamed to Sources/IndexStoreDB_Database/ImportTransaction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
#include "ImportTransactionImpl.h"
1414
#include "DatabaseImpl.h"
15-
#include "llvm/ADT/StringRef.h"
16-
#include "llvm/ADT/SmallString.h"
17-
#include "llvm/Support/Path.h"
15+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_StringRef.h>
16+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_SmallString.h>
17+
#include <IndexStoreDB_LLVMSupport/llvm_Support_Path.h>
1818

1919
using namespace IndexStoreDB;
2020
using namespace IndexStoreDB::db;

lib/Database/ImportTransactionImpl.h renamed to Sources/IndexStoreDB_Database/ImportTransactionImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef INDEXSTOREDB_SKDATABASE_LIB_IMPORTTRANSACTIONIMPL_H
1414
#define INDEXSTOREDB_SKDATABASE_LIB_IMPORTTRANSACTIONIMPL_H
1515

16-
#include "IndexStoreDB/Database/ImportTransaction.h"
17-
#include "IndexStoreDB/Database/UnitInfo.h"
16+
#include <IndexStoreDB_Database/ImportTransaction.h>
17+
#include <IndexStoreDB_Database/UnitInfo.h>
1818
#include "lmdb/lmdb++.h"
1919

2020
namespace IndexStoreDB {

lib/Database/ReadTransaction.cpp renamed to Sources/IndexStoreDB_Database/ReadTransaction.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "ReadTransactionImpl.h"
14-
#include "IndexStoreDB/Support/Path.h"
15-
#include "IndexStoreDB/Support/PatternMatching.h"
16-
#include "IndexStoreDB/Support/Logging.h"
17-
#include "llvm/ADT/ArrayRef.h"
18-
#include "llvm/ADT/StringRef.h"
19-
#include "llvm/Support/Path.h"
20-
#include "llvm/Support/raw_ostream.h"
14+
#include <IndexStoreDB_Support/Path.h>
15+
#include <IndexStoreDB_Support/PatternMatching.h>
16+
#include <IndexStoreDB_Support/Logging.h>
17+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_ArrayRef.h>
18+
#include <IndexStoreDB_LLVMSupport/llvm_ADT_StringRef.h>
19+
#include <IndexStoreDB_LLVMSupport/llvm_Support_Path.h>
20+
#include <IndexStoreDB_LLVMSupport/llvm_Support_raw_ostream.h>
2121

2222
using namespace IndexStoreDB;
2323
using namespace IndexStoreDB::db;

lib/Database/ReadTransactionImpl.h renamed to Sources/IndexStoreDB_Database/ReadTransactionImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef INDEXSTOREDB_SKDATABASE_LIB_READTRANSACTIONIMPL_H
1414
#define INDEXSTOREDB_SKDATABASE_LIB_READTRANSACTIONIMPL_H
1515

16-
#include "IndexStoreDB/Database/ReadTransaction.h"
16+
#include <IndexStoreDB_Database/ReadTransaction.h>
1717
#include "DatabaseImpl.h"
1818
#include "lmdb/lmdb++.h"
1919
#include <unordered_set>

include/IndexStoreDB/Database/Database.h renamed to Sources/IndexStoreDB_Database/include/IndexStoreDB_Database/Database.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#ifndef INDEXSTOREDB_SKDATABASE_DATABASE_H
1414
#define INDEXSTOREDB_SKDATABASE_DATABASE_H
1515

16-
#include "IndexStoreDB/Database/IDCode.h"
17-
#include "IndexStoreDB/Support/LLVM.h"
18-
#include "IndexStoreDB/Support/Visibility.h"
16+
#include <IndexStoreDB_Database/IDCode.h>
17+
#include <IndexStoreDB_Support/LLVM.h>
18+
#include <IndexStoreDB_Support/Visibility.h>
1919
#include <memory>
2020
#include <string>
2121

0 commit comments

Comments
 (0)