Skip to content

Commit

Permalink
Merge pull request #20 from toshi0383/xcode10
Browse files Browse the repository at this point in the history
Update codebase
  • Loading branch information
toshi0383 authored Dec 30, 2018
2 parents b6c3868 + 9770e08 commit bc76c63
Show file tree
Hide file tree
Showing 18 changed files with 189 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "Fixtures"]
path = Fixtures
url = git@github.com:toshi0383/xcodeproj-fixtures.git
url = https://github.com/toshi0383/xcodeproj-fixtures.git
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.5.0
* Update codebase
[Toshihiro Suzuki](https://github.com/toshi0383)
[#20](https://github.com/toshi0383/xcconfig-extractor/pull/20)

## 0.4.0
* Modify pbxproj using toshi0383/Pbxproj
[Toshihiro Suzuki](https://github.com/toshi0383)
Expand Down
2 changes: 1 addition & 1 deletion Fixtures
Submodule Fixtures updated 195 files
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
.PHONY = update build bootstrap sourcery
SOURCERY ?= ./.build/debug/sourcery
PARAM = SWIFTPM_DEVELOPMENT=YES
SOURCERY ?= sourcery

test:
$(PARAM) swift test
swift test

update:
$(PARAM) swift package update
swift package update

build:
$(PARAM) swift build
swift build

bootstrap: build
$(PARAM) swift package generate-xcodeproj
swift package generate-xcodeproj
# todo: Add fixtures to xcodeproj
sourcery:
$(SOURCERY) --templates Resources/SourceryTemplates/LinuxMain.stencil --sources Tests/ --output
Expand Down
114 changes: 0 additions & 114 deletions Package.pins

This file was deleted.

61 changes: 61 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"object": {
"pins": [
{
"package": "AEXML",
"repositoryURL": "https://github.com/tadija/AEXML",
"state": {
"branch": null,
"revision": "54bb8ea6fb693dd3f92a89e5fcc19e199fdeedd0",
"version": "4.3.3"
}
},
{
"package": "Commander",
"repositoryURL": "https://github.com/kylef/Commander",
"state": {
"branch": null,
"revision": "e5b50ad7b2e91eeb828393e89b03577b16be7db9",
"version": "0.8.0"
}
},
{
"package": "PathKit",
"repositoryURL": "https://github.com/kylef/PathKit",
"state": {
"branch": null,
"revision": "e2f5be30e4c8f531c9c1e8765aa7b71c0a45d7a0",
"version": "0.9.2"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "f14ff47f45642aa5703900980b014c2e9394b6e5",
"version": "0.9.0"
}
},
{
"package": "SwiftShell",
"repositoryURL": "https://github.com/kareman/SwiftShell",
"state": {
"branch": null,
"revision": "beebe43c986d89ea5359ac3adcb42dac94e5e08a",
"version": "4.1.2"
}
},
{
"package": "xcodeproj",
"repositoryURL": "https://github.com/tuist/xcodeproj",
"state": {
"branch": null,
"revision": "23da51abd3de3bedaad59a0afbb150b48504b5b0",
"version": "6.3.0"
}
}
]
},
"version": 1
}
38 changes: 14 additions & 24 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
// swift-tools-version:3.1
// swift-tools-version:4.2
// Managed by ice

import Foundation
import PackageDescription

var isDevelopment: Bool {
return ProcessInfo.processInfo.environment["SWIFTPM_DEVELOPMENT"] == "YES"
}

let package = Package(
name: "xcconfig-extractor",
targets: [
Target(name: "xcconfig-extractor", dependencies: ["Utilities"]),
Target(name: "Utilities"),
products: [
.executable(name: "xcconfig-extractor", targets: ["xcconfig-extractor"]),
],
dependencies: [
.package(url: "https://github.com/kylef/PathKit", from: "0.9.2"),
.package(url: "https://github.com/kylef/Commander", from: "0.8.0"),
.package(url: "https://github.com/tuist/xcodeproj", from: "6.3.0"),
],
dependencies: {
var deps: [Package.Dependency] = [
.Package(url: "https://github.com/kylef/Commander.git", majorVersion: 0),
.Package(url: "https://github.com/kylef/PathKit.git", majorVersion: 0),
.Package(url: "https://github.com/toshi0383/Pbxproj.git", majorVersion: 0),
]
if isDevelopment {
deps += [
.Package(url: "https://github.com/krzysztofzablocki/Sourcery.git", majorVersion: 0, minor: 6),
]
}
return deps
}(),
exclude: ["Resources/SourceryTemplates"]
targets: [
.target(name: "xcconfig-extractor", dependencies: ["Utilities", "PathKit", "Commander", "xcodeproj"]),
.target(name: "Utilities", dependencies: ["xcodeproj", "PathKit", "Commander"]),
.testTarget(name: "UtilitiesTests", dependencies: ["Utilities"]),
]
)

16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# xcconfig-extractor
Refactor buildSettings into xcconfigs with one shot🚀
Refactor buildSettings into xcconfigs.

[![Build Status](https://www.bitrise.io/app/9823e204182ddb41.svg?token=hychUqBHuvhZfzLLl2Ehiw&branch=master)](https://www.bitrise.io/app/9823e204182ddb41)
[![Build Status](https://app.bitrise.io/app/31197448d2a1080e/status.svg?token=_xOjshR6oPSWAMcHBH3rqg&branch=master)](https://app.bitrise.io/app/31197448d2a1080e)
[![patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/bePatron?u=13627375)

# Requirements
- Xcode8+ is officially supported, but should work against older ones too.
- Xcode10+ is officially supported, but should work against older ones too.

# Usage

Expand Down Expand Up @@ -65,16 +66,23 @@ e.g.
```
# Install
## install.sh
## Binary install
I've written install/release scripts for SwiftPM executable.
This should be the easiest way.
```
bash <(curl -sL https://raw.githubusercontent.com/toshi0383/scripts/master/swiftpm/install.sh) toshi0383/xcconfig-extractor
```

Or go to the [release page](https://github.com/toshi0383/xcconfig-extractor/releases) and download `xcconfig-extractor.zip` go download the standalone binary manually.

## Build from source
- Clone this repo and run `swift build -c release`.
- Executable will be created at `.build/release/xcconfig-extractor`.

# Donate
If you think it's a useful tool, consider donation to maintain project.
[![patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/bePatron?u=13627375)
# License
MIT
13 changes: 0 additions & 13 deletions Sources/Utilities/OperatorAndFunctions.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
//
// OperatorAndFunctions.swift
// xcconfig-extractor
//
// Created by Toshihiro Suzuki on 2017/04/27.
// Copyright © 2017 Toshihiro Suzuki. All rights reserved.
//

import Foundation
import PathKit
import AsciiPlistParser

public func compare(_ l: Any, _ r: Any) -> Bool {
switch l {
Expand Down Expand Up @@ -44,10 +35,6 @@ public func compare(_ l: Any, _ r: Any) -> Bool {
public func convertToLines(_ dictionary: [String: Any]) -> [String] {
let result = dictionary.map { (k, v) -> String in
switch v {
case let s as StringValue:
return "\(k) = \(s.value)"
case let s as [StringValue]:
return "\(k) = \(s.map{$0.value}.joined(separator: " "))"
case let s as String:
return "\(k) = \(s)"
case let s as [String]:
Expand Down
19 changes: 8 additions & 11 deletions Sources/Utilities/PathKit+Commander.swift
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
//
// PathKit+Commander.swift
// xcconfig-extractor
//
// Created by Toshihiro Suzuki on 2017/04/27.
// Copyright © 2017 toshi0383. All rights reserved.
//

import Foundation

import Commander
import Foundation
import PathKit

extension Path : ArgumentConvertible {
// MARK: ArgumentConvertible

extension Path: ArgumentConvertible {

public init(parser: ArgumentParser) throws {

guard let path = parser.shift() else {
throw ArgumentError.missingValue(argument: nil)
}

self = Path(path)
}

}
11 changes: 1 addition & 10 deletions Sources/Utilities/Validators.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
//
// Validators.swift
// xcconfig-extractor
//
// Created by Toshihiro Suzuki on 2017/04/27.
// Copyright © 2017 Toshihiro Suzuki. All rights reserved.
//

import Foundation

import Commander
import Foundation
import PathKit

public func checkPath(type: String, assertion: @escaping (Path) -> Bool) -> ((Path) throws -> Path) {
Expand Down
12 changes: 12 additions & 0 deletions Sources/Utilities/Xcodeproj.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Foundation
import xcodeproj

extension PBXProj {
public var targets: [PBXNativeTarget] {
return nativeTargets
}

public func fileReferences(named nameOrPath: String) -> [PBXFileReference] {
return groups.map { $0.file(named: nameOrPath) }.compactMap { $0 }
}
}
Loading

0 comments on commit bc76c63

Please sign in to comment.