Skip to content

Commit

Permalink
Merge pull request #68 from DroidKaigi/ios-swiftgen
Browse files Browse the repository at this point in the history
[iOS] Introduce SwiftGen
  • Loading branch information
ry-itto authored Aug 26, 2022
2 parents dab187c + 32beaa1 commit c048cc8
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "swiftgenplugin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftGen/SwiftGenPlugin",
"state" : {
"revision" : "879b85a470cacd70c19e22eb7e11a3aed66f4068",
"version" : "6.6.2"
}
}
],
"version" : 2
}
14 changes: 14 additions & 0 deletions app-ios/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "swiftgenplugin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftGen/SwiftGenPlugin",
"state" : {
"revision" : "879b85a470cacd70c19e22eb7e11a3aed66f4068",
"version" : "6.6.2"
}
}
],
"version" : 2
}
16 changes: 15 additions & 1 deletion app-ios/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,35 @@ import PackageDescription

let package = Package(
name: "DroidKaigiPackage",
defaultLocalization: "en",
platforms: [
.iOS(.v15),
],
products: [
.library(
name: "AppFeature",
targets: ["AppFeature"]),
.library(name: "Strings", targets: ["Strings"]),
],
dependencies: [
.package(url: "https://github.com/SwiftGen/SwiftGenPlugin", from: "6.6.2"),
],
targets: [
.target(
name: "AppFeature",
dependencies: [
.target(name: "TimetableFeature")
.target(name: "Strings"),
.target(name: "TimetableFeature"),
]
),
.target(
name: "Strings",
resources: [
.process("swiftgen.yml"),
.process("Resources"),
],
plugins: [
.plugin(name: "SwiftGenPlugin", package: "SwiftGenPlugin"),
]
),
.target(
Expand Down
3 changes: 2 additions & 1 deletion app-ios/Sources/AppFeature/AppView.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import SwiftUI
import Strings
import TimetableFeature

public struct AppView: View {
Expand All @@ -14,7 +15,7 @@ public struct AppView: View {
TabView(selection: $selectedTab) {
TimetableView(timetable: .companion.fake())
.tabItem {
Label("Timetable", systemImage: "questionmark.circle")
Label(L10n.Timetable.title, systemImage: "questionmark.circle")
}
}
}
Expand Down
1 change: 1 addition & 0 deletions app-ios/Sources/Strings/L10n.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Timetable.Title" = "Timetable";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Timetable.Title" = "Timetable";
11 changes: 11 additions & 0 deletions app-ios/Sources/Strings/swiftgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
input_dir: Resources/
output_dir: ${DERIVED_SOURCES_DIR}/

strings:
inputs: en.lproj
filter: .+\.strings$
outputs:
templateName: structured-swift5
output: L10n.generated.swift
params:
publicAccess: true

0 comments on commit c048cc8

Please sign in to comment.