@@ -40,7 +40,8 @@ func run() throws {
40
40
}
41
41
42
42
func ensurePluginAvailable( ) throws {
43
-
43
+ var foundAtLeastOne = false
44
+ for manifestName in [ " 6.2 " , " 6.1 " , " 6.0 " , " 5.10 " , " 5.9 " , " 5.8 " , " 5.7 " ] . map ( { " Package@swift- \( $0) .swift " } ) + [ " Package.swift " ] {
44
45
print ( " ⚙️ Checking for manifest \( manifestName) " )
45
46
let manifestUrl = URL . currentDirectory ( ) . appending ( component: manifestName)
46
47
var manifestContents : String
@@ -49,22 +50,24 @@ func ensurePluginAvailable() throws {
49
50
catch let error as NSError where error. isPOSIXError ( . ENOENT) { continue }
50
51
51
52
if !manifestContents. contains ( " .package(url: \" https://github.com/apple/swift-docc-plugin " ) {
52
- // This is freely admitted to be quick and dirty. When SE-0301 gets into a release, we can use that .
53
- print ( " 🧬 Injecting missing DocC plugin dependency " )
53
+ // This is freely admitted to be quick and dirty. Unfortunately, swift package add-dependency doesn't understand version-tagged manifests .
54
+ print ( " 🧬 Injecting DocC plugin dependency into \( manifestName ) " )
54
55
guard let depsArrayRange = manifestContents. firstRange ( of: " dependencies: [ " ) else {
55
56
print ( " ❌ ERROR: Can't inject swift-docc-plugin dependency (can't find deps array). " )
56
57
exit ( 1 )
57
58
}
58
59
manifestContents. insert (
59
- contentsOf: " \n .package(url: \" https://github.com/apple/swift-docc-plugin.git \" , from: \" 1.3 .0 \" ), \n " ,
60
+ contentsOf: " \n .package(url: \" https://github.com/apple/swift-docc-plugin.git \" , from: \" 1.4 .0 \" ), \n " ,
60
61
at: depsArrayRange. upperBound
61
62
)
62
63
try manifestContents. write ( to: manifestUrl, atomically: true , encoding: . utf8)
63
64
}
64
- return
65
+ foundAtLeastOne = true
66
+ }
67
+ guard foundAtLeastOne else {
68
+ print ( " ❌ ERROR: Can't inject swift-docc-plugin dependency (no usable manifest found). " )
69
+ exit ( 1 )
65
70
}
66
- print ( " ❌ ERROR: Can't inject swift-docc-plugin dependency (no usable manifest found). " )
67
- exit ( 1 )
68
71
}
69
72
70
73
func generateDocs( module: String ) throws {
@@ -99,10 +102,9 @@ func generateDocs(module: String) throws {
99
102
" --target " , module,
100
103
" --disable-indexing " ,
101
104
" --experimental-skip-synthesized-symbols " ,
102
- " --fallback-display-name " , module,
103
- " --fallback-bundle-identifier " , " codes.vapor. \( packageName. lowercased ( ) ) . \( module. lowercased ( ) ) " ,
104
- " --fallback-bundle-version " , " 1.0.0 " ,
105
- " --transform-for-static-hosting " ,
105
+ " --enable-inherited-docs " ,
106
+ " --enable-experimental-overloaded-symbol-presentation " ,
107
+ " --enable-experimental-mentioned-in " ,
106
108
" --hosting-base-path " , " / \( module. lowercased ( ) ) " ,
107
109
" --output-path " , publicDirectoryUrl. appending ( component: " \( module. lowercased ( ) ) " ) . path,
108
110
] )
0 commit comments