Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build the GTK renderer on Ubuntu on CI #347

Merged
merged 8 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,31 @@ jobs:
brew install gtk+3

make build

gtk_ubuntu_18_04_build:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- name: Build the GTK renderer on Ubuntu 18.04
shell: bash
run: |
set -ex
sudo apt-get update
sudo apt-get install libgtk+-3.0 gtk+-3.0

make build

gtk_ubuntu_20_04_build:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Build the GTK renderer on Ubuntu 20.04
shell: bash
run: |
set -ex
sudo apt-get update
sudo apt-get install libgtk+-3.0 gtk+-3.0

make build
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
check-labels:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Match PR Label
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SWIFT_C_FLAGS ?= -Xcc $(shell echo $(C_FLAGS) | sed -e "s/ / -Xcc /g")
all: build

build:
swift build --product TokamakGTKDemo $(SWIFT_C_FLAGS) $(SWIFT_LINKER_FLAGS)
swift build --enable-test-discovery --product TokamakGTKDemo $(SWIFT_C_FLAGS) $(SWIFT_LINKER_FLAGS)

run: build
.build/debug/TokamakGTKDemo
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"repositoryURL": "https://github.com/TokamakUI/OpenCombine.git",
"state": {
"branch": null,
"revision": "bccff3e7c84bc559e1aa0aa9ca878400360d439d",
"version": "0.12.0-alpha2"
"revision": "eea5e707b571da14fce588000046b8ec4c62018b",
"version": "0.12.0-alpha3"
}
},
{
"package": "OpenCombineJS",
"repositoryURL": "https://github.com/swiftwasm/OpenCombineJS.git",
"state": {
"branch": null,
"revision": "b346f955ed21ab44576e204a7554210c77f69b9b",
"version": "0.0.1"
"revision": "5e8636b15bcb4b8900696d95daaab941458ed2cf",
"version": "0.0.2"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ let package = Package(
.upToNextMinor(from: "0.9.0")
),
.package(url: "https://github.com/MaxDesiatov/Runtime.git", from: "2.1.2"),
.package(url: "https://github.com/TokamakUI/OpenCombine.git", from: "0.12.0-alpha2"),
.package(url: "https://github.com/swiftwasm/OpenCombineJS.git", from: "0.0.1"),
.package(url: "https://github.com/TokamakUI/OpenCombine.git", from: "0.12.0-alpha3"),
.package(url: "https://github.com/swiftwasm/OpenCombineJS.git", .upToNextMinor(from: "0.0.2")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define
Expand Down
10 changes: 5 additions & 5 deletions Sources/TokamakCore/MountedViews/MountedElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ public class MountedElement<R: Renderer> {
var typeConstructorName: String {
switch element {
case .app: fatalError("""
`App` values aren't supposed to be reconciled, thus the type constructor name is not stored \
for `App` elements. Please report this crash as a bug at \
https://github.com/swiftwasm/Tokamak/issues/new
""")
`App` values aren't supposed to be reconciled, thus the type constructor name is not stored \
for `App` elements. Please report this crash as a bug at \
https://github.com/swiftwasm/Tokamak/issues/new
""")
case let .scene(scene): return scene.typeConstructorName
case let .view(view): return view.typeConstructorName
}
Expand Down Expand Up @@ -172,7 +172,7 @@ extension TypeInfo {
// swiftlint:disable force_try
// Extract the view from the AnyView for modification, apply Environment changes:
if genericTypes.contains(where: { $0 is EnvironmentModifier.Type }),
let modifier = try! property(named: "modifier").get(from: element) as? EnvironmentModifier
let modifier = try! property(named: "modifier").get(from: element) as? EnvironmentModifier
{
modifier.modifyEnvironment(&modifiedEnv)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/TokamakCore/MountedViews/MountedScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ extension _AnyScene {
) -> MountedScene<R> {
var title: String?
if let titledSelf = scene as? TitledScene,
let text = titledSelf.title
let text = titledSelf.title
{
title = _TextProxy(text).rawText
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/TokamakCore/Views/Selectors/Picker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public struct Picker<Label: View, SelectionValue: Hashable, Content: View>: View
// update the binding.
ForEach(0..<children.count) { index in
if let forEach = mapAnyView(children[index], transform: { (v: ForEachProtocol) in v }),
forEach.elementType == SelectionValue.self
forEach.elementType == SelectionValue.self
{
let nestedChildren = forEach.children

Expand Down
4 changes: 2 additions & 2 deletions Sources/TokamakDemo/ColorDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import TokamakShim
public struct ColorDemo: View {
var color: Color {
guard let v0d = Double(v0),
let v1d = Double(v1),
let v2d = Double(v2)
let v1d = Double(v1),
let v2d = Double(v2)
else {
return .white
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/TokamakGTK/Modifiers/LayoutModifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extension _OverlayModifier: WidgetAttributeModifier, WidgetModifier
"border-style": style,
"border-width": "\(overlay.shape.style.lineWidth)px",
"border-color": overlay.style.cssValue(environment),
"border-radius": "inherit"
"border-radius": "inherit",
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/TokamakGTK/Widget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ extension AnyWidget {

struct WidgetView<Content: View>: View, AnyWidget, ParentView {
let build: (UnsafeMutablePointer<GtkApplication>) -> UnsafeMutablePointer<GtkWidget>
let update: (Widget) -> Void
let update: (Widget) -> ()
let content: Content
let expand: Bool

init(build: @escaping (UnsafeMutablePointer<GtkApplication>) -> UnsafeMutablePointer<GtkWidget>,
update: @escaping (Widget) -> Void = { _ in },
update: @escaping (Widget) -> () = { _ in },
expand: Bool = false,
@ViewBuilder content: () -> Content)
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/TokamakStaticHTML/Modifiers/ModifiedContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extension ModifiedContent: ViewDeferredToRenderer where Content: View, Modifier:
public var deferredBody: AnyView {
if let domModifier = modifier as? DOMViewModifier {
if let adjacentModifier = content as? AnyModifiedContent,
!(adjacentModifier.anyModifier.isOrderDependent || domModifier.isOrderDependent)
!(adjacentModifier.anyModifier.isOrderDependent || domModifier.isOrderDependent)
{
// Flatten non-order-dependent modifiers
var attr = domModifier.attributes
Expand Down