Skip to content

Commit

Permalink
fix: Add a GitHub link to the Yams license (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmorley authored Apr 25, 2024
1 parent e108ce5 commit ace0275
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 9 deletions.
10 changes: 9 additions & 1 deletion Thoughts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
D8C283F52BD9988200161C82 /* CenteredFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8C283F42BD9988200161C82 /* CenteredFlowLayout.swift */; };
D8C283F72BD9ADC400161C82 /* hashrainbow-license in Resources */ = {isa = PBXBuildFile; fileRef = D8C283F62BD9ADC400161C82 /* hashrainbow-license */; };
D8DFFCC82BD82DE900C9532A /* CLAuthorizationStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8DFFCC72BD82DE900C9532A /* CLAuthorizationStatus.swift */; };
D8E27EA42BD9EA53001EEE98 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8E27EA32BD9EA53001EEE98 /* String.swift */; };
D8E27EA62BD9EB61001EEE98 /* Licensable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8E27EA52BD9EB61001EEE98 /* Licensable.swift */; };
D8F06D4B2B67275B0039AEF4 /* Diligence in Frameworks */ = {isa = PBXBuildFile; productRef = D8F06D4A2B67275B0039AEF4 /* Diligence */; };
D8F06D4E2B6727630039AEF4 /* Interact in Frameworks */ = {isa = PBXBuildFile; productRef = D8F06D4D2B6727630039AEF4 /* Interact */; };
D8F06D512B6731CE0039AEF4 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F06D502B6731CE0039AEF4 /* SettingsView.swift */; };
Expand Down Expand Up @@ -101,6 +103,8 @@
D8C283F42BD9988200161C82 /* CenteredFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CenteredFlowLayout.swift; sourceTree = "<group>"; };
D8C283F62BD9ADC400161C82 /* hashrainbow-license */ = {isa = PBXFileReference; lastKnownFileType = text; path = "hashrainbow-license"; sourceTree = "<group>"; };
D8DFFCC72BD82DE900C9532A /* CLAuthorizationStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CLAuthorizationStatus.swift; sourceTree = "<group>"; };
D8E27EA32BD9EA53001EEE98 /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
D8E27EA52BD9EB61001EEE98 /* Licensable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Licensable.swift; sourceTree = "<group>"; };
D8F06D502B6731CE0039AEF4 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
D8F06D532B6733650039AEF4 /* thoughts-license */ = {isa = PBXFileReference; lastKnownFileType = text; path = "thoughts-license"; sourceTree = "<group>"; };
D8F06D552B6734540039AEF4 /* material-icons-license */ = {isa = PBXFileReference; lastKnownFileType = text; path = "material-icons-license"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -156,6 +160,8 @@
D8DFFCC72BD82DE900C9532A /* CLAuthorizationStatus.swift */,
D87310CE2BD9B03300E2064A /* Color.swift */,
D850C2D32B69D85400338546 /* KeyedDefaults.swift */,
D8E27EA52BD9EB61001EEE98 /* Licensable.swift */,
D8E27EA32BD9EA53001EEE98 /* String.swift */,
D89224A12BD7365C00DA0932 /* TimeZone.swift */,
D83C2F872B857B8C00CE60F7 /* URL.swift */,
);
Expand Down Expand Up @@ -270,10 +276,10 @@
D8F06D522B6733440039AEF4 /* Licenses */ = {
isa = PBXGroup;
children = (
D8C283F62BD9ADC400161C82 /* hashrainbow-license */,
D8F06D552B6734540039AEF4 /* material-icons-license */,
D8F06D532B6733650039AEF4 /* thoughts-license */,
D84010C42BD74C760049715E /* yams-license */,
D8C283F62BD9ADC400161C82 /* hashrainbow-license */,
);
path = Licenses;
sourceTree = "<group>";
Expand Down Expand Up @@ -437,9 +443,11 @@
D892249E2BD735BE00DA0932 /* ThoughtsError.swift in Sources */,
D8C283F22BD995CC00161C82 /* TagView.swift in Sources */,
D850C2D42B69D85400338546 /* KeyedDefaults.swift in Sources */,
D8E27EA62BD9EB61001EEE98 /* Licensable.swift in Sources */,
D87310CF2BD9B03300E2064A /* Color.swift in Sources */,
D852AF662B604B1200B77A3D /* ComposeView.swift in Sources */,
D8F06D512B6731CE0039AEF4 /* SettingsView.swift in Sources */,
D8E27EA42BD9EA53001EEE98 /* String.swift in Sources */,
D80E08A62B6761370023DD4F /* Document.swift in Sources */,
D8C283F52BD9988200161C82 /* CenteredFlowLayout.swift in Sources */,
D852AF022B6027CA00B77A3D /* ThoughtsApp.swift in Sources */,
Expand Down
71 changes: 71 additions & 0 deletions Thoughts/Extensions/Licensable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright (c) 2024 Jason Morley
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import Foundation

import Interact
import Licensable

fileprivate let materialIconsLicense = License(id: "https://github.com/google/material-design-icons",
name: "Material Icons",
author: "Google",
text: String(contentsOfResource: "material-icons-license"),
attributes: [
.url(URL(string: "https://github.com/google/material-design-icons")!,
title: "GitHub"),
])

fileprivate let hashRainbowLicense = License(id: "https://github.com/saramah/HashRainbow",
name: "HashRainbow",
author: "Sarah Barbour",
text: String(contentsOfResource: "hashrainbow-license"),
attributes: [
.url(URL(string: "https://github.com/saramah/HashRainbow")!,
title: "GitHub"),
])

fileprivate let yamsLicense = License(id: "https://github.com/jpsim/Yams",
name: "Yams",
author: "JP Simard",
text: String(contentsOfResource: "yams-license"),
attributes: [
.url(URL(string: "https://github.com/jpsim/Yams")!, title: "GitHub"),
])

fileprivate let thoughtsLicense = License(id: "https://github.com/inseven/thoughts",
name: "Thoughts",
author: "Jason Morley",
text: String(contentsOfResource: "thoughts-license"),
attributes: [
.url(URL(string: "https://github.com/inseven/thoughts")!, title: "GitHub"),
],
licenses: [
.interact,
.licensable,
materialIconsLicense,
hashRainbowLicense,
yamsLicense,
])

extension Licensable where Self == License {

public static var thoughts: License { thoughtsLicense }

}
30 changes: 30 additions & 0 deletions Thoughts/Extensions/String.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) 2024 Jason Morley
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import Foundation

extension String {

init(contentsOfResource resource: String) {
let url = Bundle.main.url(forResource: resource, withExtension: nil)!
try! self.init(contentsOf: url)
}

}
12 changes: 4 additions & 8 deletions Thoughts/ThoughtsApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import Interact
@main
struct ThoughtsApp: App {

static let title = "Thoughts Support (\(Bundle.main.version ?? "Unknown Version"))"

var applicationModel = ApplicationModel()

var body: some Scene {
Expand All @@ -45,11 +47,9 @@ struct ThoughtsApp: App {
SettingsView(applicationModel: applicationModel)
}

let title = "Thoughts Support (\(Bundle.main.version ?? "Unknown Version"))"

About(repository: "inseven/thoughts", copyright: "Copyright © 2024 Jason Morley") {
Diligence.Action("GitHub", url: URL(string: "https://github.com/inseven/thoughts")!)
Diligence.Action("Support", url: URL(address: "[email protected]", subject: title)!)
Diligence.Action("Support", url: URL(address: "[email protected]", subject: Self.title)!)
} acknowledgements: {
Acknowledgements("Developers") {
Credit("Jason Morley", url: URL(string: "https://jbmorley.co.uk"))
Expand All @@ -59,11 +59,7 @@ struct ThoughtsApp: App {
Credit("Sarah Barbour")
}
} licenses: {
(.interact)
License("HashRainbow", author: "Sarah Barbour", filename: "hashrainbow-license")
License("Material Icons", author: "Google", filename: "material-icons-license")
License("Thoughts", author: "Jason Morley", filename: "thoughts-license")
License("Yams", author: "JP Simard", filename: "yams-license")
(.thoughts)
}
.handlesExternalEvents(matching: [.about])

Expand Down

0 comments on commit ace0275

Please sign in to comment.