Skip to content

Commit

Permalink
remove build
Browse files Browse the repository at this point in the history
rename to permissions check
  • Loading branch information
ezefranca committed Aug 29, 2024
1 parent 8c64f16 commit 9481c62
Show file tree
Hide file tree
Showing 13 changed files with 192 additions and 202 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file removed .build/arm64-apple-macosx/debug/check-permissions
Binary file not shown.
Binary file removed .build/arm64-apple-macosx/release/check-permissions
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ iOSInjectionProject/
Sources/.DS_Store
*.DS_Store
.DS_Store
.DS_Store
17 changes: 0 additions & 17 deletions Formula/check-permissions.rb

This file was deleted.

14 changes: 0 additions & 14 deletions Makefile

This file was deleted.

69 changes: 69 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"originHash" : "fd741683a7f97e5c2ddfdfb909c825fbb9a1128e572c4050653b39bae25c9500",
"pins" : [
{
"identity" : "aexml",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tadija/AEXML.git",
"state" : {
"revision" : "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3",
"version" : "4.6.1"
}
},
{
"identity" : "pathkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/PathKit.git",
"state" : {
"revision" : "3bfd2737b700b9a36565a8c94f4ad2b050a5e574",
"version" : "1.0.1"
}
},
{
"identity" : "rainbow",
"kind" : "remoteSourceControl",
"location" : "https://github.com/onevcat/Rainbow",
"state" : {
"revision" : "e0dada9cd44e3fa7ec3b867e49a8ddbf543e3df3",
"version" : "4.0.1"
}
},
{
"identity" : "spectre",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/Spectre.git",
"state" : {
"revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7",
"version" : "0.10.1"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
}
},
{
"identity" : "swiftytexttable",
"kind" : "remoteSourceControl",
"location" : "https://github.com/scottrhoyt/SwiftyTextTable.git",
"state" : {
"revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3",
"version" : "0.9.0"
}
},
{
"identity" : "xcodeproj",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tuist/XcodeProj.git",
"state" : {
"revision" : "4cd0544600459a6a37a0fb8eed5d7c21205164d6",
"version" : "8.23.3"
}
}
],
"version" : 3
}
36 changes: 23 additions & 13 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

// swift-tools-version: 5.10
import PackageDescription

let package = Package(
name: "check-permissions",
name: "permissions-scan-package",
platforms: [
.iOS(.v15),
.macOS(.v12),
Expand All @@ -13,19 +11,31 @@ let package = Package(
.visionOS(.v1)
],
products: [
.executable(name: "check-permissions-cli", targets: ["check-permissions-cli"]),
.library(name: "check-permissions", targets: ["check-permissions"]),
.executable(name: "permissions-scan", targets: ["permissions-scan"]),
.library(name: "permissions-scan-package", targets: ["permissions-scan-package"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
.package(url: "https://github.com/tuist/XcodeProj.git", from: "8.23.2"),
.package(url: "https://github.com/onevcat/Rainbow", from: "4.0.1"),
.package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", from: "0.9.0"),
],
targets: [
.executableTarget(
name: "check-permissions-cli",
dependencies: ["check-permissions"],
path: "Sources/check-permissions-cli"),
name: "permissions-scan",
dependencies: [
"permissions-scan-package",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"Rainbow",
"SwiftyTextTable"
],
path: "Sources/permissions-scan"), // Only main.swift should be here
.target(
name: "check-permissions",
path: "Sources/check-permissions"),
name: "permissions-scan-package",
path: "Sources/permissions-scan-package"), // Only PermissionChecker.swift and other library files
.testTarget(
name: "check-permissionsTests",
dependencies: ["check-permissions"]),
name: "permissions-scan-packageTests",
dependencies: ["permissions-scan-package"],
path: "Tests/check-permissionsTests") // Ensure test paths are correct
]
)
81 changes: 0 additions & 81 deletions Sources/check-permissions-cli/main.swift

This file was deleted.

54 changes: 0 additions & 54 deletions Sources/check-permissions/ConsoleColor.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class PermissionChecker {
report[plistFile.path] = permissions
}
} else {
print("Failed to parse \(plistFile.path)".consoleColor.red)
print("Failed to parse \(plistFile.path)")
}
}

Expand All @@ -110,17 +110,17 @@ public class PermissionChecker {
@discardableResult
public func printReport(for directoryURL: URL) -> [String: [String]] {
let plistFiles = findPlistFiles(in: directoryURL)
print("Found \(plistFiles.count) Info.plist files.".consoleColor.cyan) // Display the number of Info.plist files found
print("Found \(plistFiles.count) Info.plist files.") // Display the number of Info.plist files found

let report = generateReport(for: directoryURL)

if report.isEmpty {
print("No permissions found in any Info.plist files.".consoleColor.yellow)
print("No permissions found in any Info.plist files.")
} else {
for (plistPath, permissions) in report {
print("File: \(plistPath)".consoleColor.cyan)
print("File: \(plistPath)")
for permission in permissions {
print(" - \(permission)".consoleColor.green)
print(" - \(permission)")
}
}
}
Expand Down
Loading

0 comments on commit 9481c62

Please sign in to comment.