@@ -7,40 +7,40 @@ struct LicenseCheckerPlugin: BuildToolPlugin {
77 let description : String = " SourcePackages not found "
88 }
99
10- func sourcePackages( _ pluginWorkDirectory: Path ) throws -> Path {
11- var tmpPath = pluginWorkDirectory
12- guard pluginWorkDirectory. string . contains ( " SourcePackages " ) else {
10+ func sourcePackages( _ pluginWorkDirectory: URL ) throws -> URL {
11+ var tmpURL = pluginWorkDirectory
12+ guard pluginWorkDirectory. absoluteURL . path ( ) . contains ( " SourcePackages " ) else {
1313 throw SourcePackagesNotFoundError ( )
1414 }
15- while tmpPath . lastComponent != " SourcePackages " {
16- tmpPath = tmpPath . removingLastComponent ( )
15+ while tmpURL . lastPathComponent != " SourcePackages " {
16+ tmpURL = tmpURL . deletingLastPathComponent ( )
1717 }
18- return tmpPath
18+ return tmpURL
1919 }
2020
21- func makeBuildCommand( executablePath : Path , sourcePackagesPath : Path , whiteListPath : Path , outputPath : Path ) -> Command {
22- return . buildCommand(
21+ func makeBuildCommand( executableURL : URL , sourcePackagesURL : URL , whiteListURL : URL , outputURL : URL ) -> Command {
22+ . buildCommand(
2323 displayName: " Check License " ,
24- executable: executablePath ,
24+ executable: executableURL ,
2525 arguments: [
2626 " --source-packages-path " ,
27- sourcePackagesPath . string ,
27+ sourcePackagesURL . absoluteURL . path ( ) ,
2828 " --white-list-path " ,
29- whiteListPath . string
29+ whiteListURL . absoluteURL . path ( )
3030 ] ,
3131 outputFiles: [
32- outputPath
32+ outputURL
3333 ]
3434 )
3535 }
3636
3737 func createBuildCommands( context: PluginContext , target: Target ) async throws -> [ Command ] {
38- return [
38+ [
3939 makeBuildCommand (
40- executablePath : try context. tool ( named: " license-checker " ) . path ,
41- sourcePackagesPath : try sourcePackages ( context. pluginWorkDirectory ) ,
42- whiteListPath : context. package . directory . appending ( subpath : " white-list.json " ) ,
43- outputPath : context. pluginWorkDirectory
40+ executableURL : try context. tool ( named: " license-checker " ) . url ,
41+ sourcePackagesURL : try sourcePackages ( context. pluginWorkDirectoryURL ) ,
42+ whiteListURL : context. package . directoryURL . appending ( path : " white-list.json " ) ,
43+ outputURL : context. pluginWorkDirectoryURL
4444 )
4545 ]
4646 }
@@ -53,12 +53,12 @@ import XcodeProjectPlugin
5353/// This command works with `Run Build Tool Plug-ins` in Xcode `Build Phase`.
5454extension LicenseCheckerPlugin : XcodeBuildToolPlugin {
5555 func createBuildCommands( context: XcodePluginContext , target: XcodeTarget ) throws -> [ Command ] {
56- return [
56+ [
5757 makeBuildCommand (
58- executablePath : try context. tool ( named: " license-checker " ) . path ,
59- sourcePackagesPath : try sourcePackages ( context. pluginWorkDirectory ) ,
60- whiteListPath : context. xcodeProject. directory . appending ( subpath : " white-list.json " ) ,
61- outputPath : context. pluginWorkDirectory
58+ executableURL : try context. tool ( named: " license-checker " ) . url ,
59+ sourcePackagesURL : try sourcePackages ( context. pluginWorkDirectoryURL ) ,
60+ whiteListURL : context. xcodeProject. directoryURL . appending ( path : " white-list.json " ) ,
61+ outputURL : context. pluginWorkDirectoryURL
6262 )
6363 ]
6464 }
0 commit comments