- fix userscheme (#495)

- update generator to support any kind of paths (absolute and relative
  paths)
- made xcodeproj runnnuble by anyone
This commit is contained in:
Petr Korolev 2020-01-07 11:19:03 +03:00 committed by Serhii Londar
parent 9459a5a075
commit f06424d13f
3 changed files with 19 additions and 12 deletions

View file

@ -89,7 +89,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1130;
ORGANIZATIONNAME = "Serhii Londar";
TargetAttributes = {
E8FDFD71226E74F400FE80E7 = {
@ -104,6 +104,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = E8FDFD69226E74F400FE80E7;
productRefGroup = E8FDFD73226E74F400FE80E7 /* Products */;
@ -246,6 +247,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@ -262,6 +264,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@ -38,15 +36,15 @@
ReferencedContainer = "container:ReadmeGenerator.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "YES"
useCustomWorkingDirectory = "NO"
customWorkingDirectory = "/Users/serhii-londar/Documents/GitHub/open-source-mac-os-apps"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
@ -62,8 +60,6 @@
ReferencedContainer = "container:ReadmeGenerator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

14
.github/main.swift vendored
View file

@ -213,8 +213,16 @@ class ReadmeGenerator {
func generateReadme() {
print("Start")
do {
let applicationsData = try Data(contentsOf: URL(fileURLWithPath: FilePaths.applications.rawValue))
let categoriesData = try Data(contentsOf: URL(fileURLWithPath: FilePaths.categories.rawValue))
// get current file path:
let thisFilePath:String = #file
var url = URL(fileURLWithPath: thisFilePath)
//cd ../ to the root folder: (delete `.github/main.swift`
url = url.deletingLastPathComponent().deletingLastPathComponent()
let applicationsUrl = url.appendingPathComponent(FilePaths.applications.rawValue)
let applicationsData = try Data(contentsOf: applicationsUrl)
let categoriesData = try Data(contentsOf: url.appendingPathComponent(FilePaths.categories.rawValue))
let jsonDecoder = JSONDecoder()
let applicationsObject = try jsonDecoder.decode(JSONApplications.self, from: applicationsData)
let categoriesObject = try jsonDecoder.decode(Categories.self, from: categoriesData)
@ -260,7 +268,7 @@ class ReadmeGenerator {
}
print("Finish iteration...")
readmeString.append(footer)
try readmeString.data(using: .utf8)?.write(to: URL(fileURLWithPath: FilePaths.readme.rawValue))
try readmeString.data(using: .utf8)?.write(to: url.appendingPathComponent(FilePaths.readme.rawValue))
print("Finish")
} catch {
print(error)