Skip to content

Commit

Permalink
Cleanup version string.
Browse files Browse the repository at this point in the history
  • Loading branch information
furby-tm committed Feb 16, 2024
1 parent 4b49c0c commit ca78a60
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
--generictypes
--groupedextension "MARK: %c"
--guardelse auto
--header "/* --------------------------------------------------------------\n * :: : K R A K E N : ::\n * --------------------------------------------------------------\n * @wabistudios :: multiverse :: kraken\n *\n * This program is free software; you can redistribute it, and/or\n * modify it under the terms of the GNU General Public License as\n * published by the Free Software Foundation; either version 2 of\n * the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Check out\n * the GNU General Public License for more details.\n *\n * You should have received a copy for this software license, the\n * GNU General Public License along with this program; or, if not\n * write to the Free Software Foundation, Inc., to the address of\n * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (C) 2023 Wabi Foundation. \n * All Rights Reserved.\n * --------------------------------------------------------------\n * . x x x . o o o . x x x . : : : . o x o . : : : .\n * -------------------------------------------------------------- */"
--header "/* --------------------------------------------------------------\n * :: : K R A K E N : ::\n * --------------------------------------------------------------\n * @wabistudios :: metaverse :: kraken\n *\n * This program is free software; you can redistribute it, and/or\n * modify it under the terms of the GNU General Public License as\n * published by the Free Software Foundation; either version 2 of\n * the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Check out\n * the GNU General Public License for more details.\n *\n * You should have received a copy for this software license, the\n * GNU General Public License along with this program; or, if not\n * write to the Free Software Foundation, Inc., to the address of\n * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (C) 2023 Wabi Foundation. \n * All Rights Reserved.\n * --------------------------------------------------------------\n * . x x x . o o o . x x x . : : : . o x o . : : : .\n * -------------------------------------------------------------- */"
--hexgrouping 4,8
--hexliteralcase uppercase
--ifdef indent
Expand Down
2 changes: 1 addition & 1 deletion Kraken.usda
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#usda 1.0
(
doc = "Kraken v1.0.5"
doc = "Kraken v1.0.6"
)

def Xform "Hello"
Expand Down
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"location" : "https://github.com/wabiverse/SwiftUSD.git",
"state" : {
"branch" : "dev",
"revision" : "e0ade16549bd380a16ab1283c3378ad53f2bbf39"
"revision" : "b18ac0d5b1cc4d8289cb84a78f4719602fd4a449"
}
},
{
Expand Down
16 changes: 15 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ let package = Package(
name: "KrakenKit",
targets: ["KrakenKit"]
),
.library(
name: "KrakenLib",
targets: ["KrakenLib"]
),
.library(
name: "KrakenUI",
targets: ["KrakenUI"]
Expand All @@ -37,6 +41,16 @@ let package = Package(
targets: [
.target(name: "KrakenKit"),

.target(
name: "KrakenLib",
dependencies: [
.product(name: "PixarUSD", package: "SwiftUSD"),
],
swiftSettings: [
.interoperabilityMode(.Cxx)
]
),

.target(
name: "KrakenUI",
dependencies: [
Expand All @@ -49,13 +63,13 @@ let package = Package(
dependencies: [
.product(name: "PixarUSD", package: "SwiftUSD"),
.target(name: "KrakenKit"),
.target(name: "KrakenLib"),
.target(name: "KrakenUI"),
],
resources: [
.process("Resources")
],
swiftSettings: [
// needed for SwiftUSD.
.interoperabilityMode(.Cxx)
]
),
Expand Down
53 changes: 23 additions & 30 deletions Sources/Kraken/Creator.swift
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
/* ----------------------------------------------------------------
* :: : M E T A V E R S E : ::
* ----------------------------------------------------------------
* This software is Licensed under the terms of the Apache License,
* version 2.0 (the "Apache License") with the following additional
* modification; you may not use this file except within compliance
* of the Apache License and the following modification made to it.
* Section 6. Trademarks. is deleted and replaced with:
/* --------------------------------------------------------------
* :: : K R A K E N : ::
* --------------------------------------------------------------
* @wabistudios :: metaverse :: kraken
*
* Trademarks. This License does not grant permission to use any of
* its trade names, trademarks, service marks, or the product names
* of this Licensor or its affiliates, except as required to comply
* with Section 4(c.) of this License, and to reproduce the content
* of the NOTICE file.
* This program is free software; you can redistribute it, and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND without even an
* implied warranty of MERCHANTABILITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the Apache License for more details.
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Check out
* the GNU General Public License for more details.
*
* You should have received a copy for this software license of the
* Apache License along with this program; or, if not, please write
* to the Free Software Foundation Inc., with the following address
* You should have received a copy for this software license, the
* GNU General Public License along with this program; or, if not
* write to the Free Software Foundation, Inc., to the address of
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (C) 2024 Wabi Foundation. All Rights Reserved.
* ----------------------------------------------------------------
* Copyright (C) 2023 Wabi Foundation.
* All Rights Reserved.
* --------------------------------------------------------------
* . x x x . o o o . x x x . : : : . o x o . : : : .
* ---------------------------------------------------------------- */
* -------------------------------------------------------------- */

import Foundation
import KrakenKit
import KrakenLib
import KrakenUI
import PixarUSD
import PyBundle
Expand All @@ -39,7 +36,7 @@ import SwiftUI
@main
struct Kraken: App
{
static let version = Pixar.GfVec3i(1, 0, 5)
static let version = Pixar.GfVec3i(1, 0, 6)

init()
{
Expand All @@ -52,7 +49,7 @@ struct Kraken: App

/* -------------------------------------------------------- */

let stage = Usd.Stage.createNew("ExampleScene.usda")
let stage = Usd.Stage.createNew("ExampleScene", ext: .usda)

UsdGeom.Xform.define(stage, path: "/Hello")
UsdGeom.Sphere.define(stage, path: "/Hello/World")
Expand Down Expand Up @@ -100,11 +97,7 @@ extension Kraken
{
var versionStr: String
{
let v = Kraken.version.getArray().map
{
String($0)
}
.joined(separator: ".")
let v = ".".join(array: Kraken.version)

Msg.logger.log(level: .info, "\("Kraken".magenta) \("v".yellow)\(v.yellow)")

Expand Down
59 changes: 59 additions & 0 deletions Sources/KrakenLib/StrContainer.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* --------------------------------------------------------------
* :: : K R A K E N : ::
* --------------------------------------------------------------
* @wabistudios :: metaverse :: kraken
*
* This program is free software; you can redistribute it, and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Check out
* the GNU General Public License for more details.
*
* You should have received a copy for this software license, the
* GNU General Public License along with this program; or, if not
* write to the Free Software Foundation, Inc., to the address of
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (C) 2023 Wabi Foundation.
* All Rights Reserved.
* --------------------------------------------------------------
* . x x x . o o o . x x x . : : : . o x o . : : : .
* -------------------------------------------------------------- */

import Foundation
import PixarUSD

public extension String
{
/// Join a given scalar type by returning a new
/// single string whose elements are separated
/// by the content of the current string.
///
/// This example joins each of the elements of
/// a ``Pixar.GfVec3i`` as a new string, with
/// each element separated by the given `"."`
/// string.
/// ```swift
/// let version = Pixar.GfVec3i(1, 0, 0)
///
/// print(".".join(array: version))
/// // Prints "1.0.0"
/// ```
func join(array: some Scalar) -> String
{
var str = ""
for (index, item) in array.enumerated()
{
str += "\(item)"
if index < array.getArray().count - 1
{
str += self
}
}
return str
}
}

0 comments on commit ca78a60

Please sign in to comment.