Skip to content

Commit

Permalink
feat(sdds-icore): added generation of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
vkaltyrin committed Apr 8, 2024
1 parent 92ba14b commit f44a533
Show file tree
Hide file tree
Showing 8 changed files with 744 additions and 6 deletions.
38 changes: 38 additions & 0 deletions SDDSIcons/Generated/Assets.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// swiftlint:disable all

Check warning on line 1 in SDDSIcons/Generated/Assets.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Blanket Disable Command Violation: The disabled 'all' rule should be re-enabled before the end of the file (blanket_disable_command)
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen


#if os(iOS)
import UIKit
#elseif os(tvOS) || os(watchOS)
import UIKit
#endif
#if canImport(SwiftUI)
import SwiftUI
#endif

// Deprecated typealiases

// swiftlint:disable superfluous_disable_command file_length implicit_return

// MARK: - Asset Catalogs

// swiftlint:disable identifier_name line_length nesting type_body_length type_name
public enum Asset {
}
// swiftlint:enable identifier_name line_length nesting type_body_length type_name

// MARK: - Implementation Details

// swiftlint:disable convenience_type
private final class BundleToken {
static let bundle: Bundle = {
#if SWIFT_PACKAGE
return Bundle.module
#else
return Bundle(for: BundleToken.self)
#endif
}()
}
// swiftlint:enable convenience_type

21 changes: 21 additions & 0 deletions SDDSIcons/LICENCE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Salute Devices

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.
135 changes: 129 additions & 6 deletions SDDSIcons/SDDSIcons.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@
objectVersion = 56;
objects = {

/* Begin PBXAggregateTarget section */
242BF25E2BBDA0C300E4D112 /* Build XCFramework */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 242BF2612BBDA0C400E4D112 /* Build configuration list for PBXAggregateTarget "Build XCFramework" */;
buildPhases = (
242BF2622BBDA0CC00E4D112 /* Run Script */,
);
dependencies = (
);
name = "Build XCFramework";
productName = "Build XCFramework";
};
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
242BF2422BBC600D00E4D112 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 242BF2412BBC600D00E4D112 /* Assets.xcassets */; };
242BF24F2BBC687700E4D112 /* Assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 242BF24E2BBC687700E4D112 /* Assets.swift */; };
2430DEA02BB5B53B00277123 /* SDDSIcons.docc in Sources */ = {isa = PBXBuildFile; fileRef = 2430DE9F2BB5B53B00277123 /* SDDSIcons.docc */; };
2430DEA62BB5B53B00277123 /* SDDSIcons.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2430DE9B2BB5B53B00277123 /* SDDSIcons.framework */; };
2430DEAB2BB5B53B00277123 /* SDDSIconsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2430DEAA2BB5B53B00277123 /* SDDSIconsTests.swift */; };
Expand All @@ -24,11 +40,19 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
242BF2412BBC600D00E4D112 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
242BF2472BBC673300E4D112 /* swiftgen.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = swiftgen.yml; sourceTree = "<group>"; };
242BF24E2BBC687700E4D112 /* Assets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Assets.swift; sourceTree = "<group>"; };
242BF2552BBD8AB000E4D112 /* assets.stencil */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = assets.stencil; sourceTree = "<group>"; };
242BF2582BBD941D00E4D112 /* build_xcframework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build_xcframework.sh; sourceTree = "<group>"; };
242BF26B2BBDA47A00E4D112 /* SDDSIcons.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = SDDSIcons.xcframework; sourceTree = "<group>"; };
242BF26E2BBDAE4A00E4D112 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
2430DE9B2BB5B53B00277123 /* SDDSIcons.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDDSIcons.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2430DE9E2BB5B53B00277123 /* SDDSIcons.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDDSIcons.h; sourceTree = "<group>"; };
2430DE9F2BB5B53B00277123 /* SDDSIcons.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = SDDSIcons.docc; sourceTree = "<group>"; };
2430DEA52BB5B53B00277123 /* SDDSIconsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SDDSIconsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2430DEAA2BB5B53B00277123 /* SDDSIconsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDDSIconsTests.swift; sourceTree = "<group>"; };
243C6C462BBF14E900525EAD /* info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -50,9 +74,48 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
242BF24D2BBC687700E4D112 /* Generated */ = {
isa = PBXGroup;
children = (
242BF24E2BBC687700E4D112 /* Assets.swift */,
);
path = Generated;
sourceTree = "<group>";
};
242BF2542BBD8AB000E4D112 /* Templates */ = {
isa = PBXGroup;
children = (
242BF2552BBD8AB000E4D112 /* assets.stencil */,
);
path = Templates;
sourceTree = "<group>";
};
242BF2572BBD940700E4D112 /* Scripts */ = {
isa = PBXGroup;
children = (
242BF2582BBD941D00E4D112 /* build_xcframework.sh */,
);
path = Scripts;
sourceTree = "<group>";
};
242BF26A2BBDA47A00E4D112 /* build */ = {
isa = PBXGroup;
children = (
242BF26B2BBDA47A00E4D112 /* SDDSIcons.xcframework */,
);
path = build;
sourceTree = "<group>";
};
2430DE912BB5B53B00277123 = {
isa = PBXGroup;
children = (
243C6C462BBF14E900525EAD /* info.plist */,
242BF26E2BBDAE4A00E4D112 /* Package.swift */,
242BF2472BBC673300E4D112 /* swiftgen.yml */,
242BF26A2BBDA47A00E4D112 /* build */,
242BF24D2BBC687700E4D112 /* Generated */,
242BF2572BBD940700E4D112 /* Scripts */,
242BF2542BBD8AB000E4D112 /* Templates */,
2430DE9D2BB5B53B00277123 /* SDDSIcons */,
2430DEA92BB5B53B00277123 /* SDDSIconsTests */,
2430DE9C2BB5B53B00277123 /* Products */,
Expand All @@ -73,6 +136,7 @@
children = (
2430DE9E2BB5B53B00277123 /* SDDSIcons.h */,
2430DE9F2BB5B53B00277123 /* SDDSIcons.docc */,
242BF2412BBC600D00E4D112 /* Assets.xcassets */,
);
path = SDDSIcons;
sourceTree = "<group>";
Expand Down Expand Up @@ -146,6 +210,9 @@
LastSwiftUpdateCheck = 1520;
LastUpgradeCheck = 1520;
TargetAttributes = {
242BF25E2BBDA0C300E4D112 = {
CreatedOnToolsVersion = 15.2;
};
2430DE9A2BB5B53B00277123 = {
CreatedOnToolsVersion = 15.2;
};
Expand All @@ -169,6 +236,7 @@
targets = (
2430DE9A2BB5B53B00277123 /* SDDSIcons */,
2430DEA42BB5B53B00277123 /* SDDSIconsTests */,
242BF25E2BBDA0C300E4D112 /* Build XCFramework */,
);
};
/* End PBXProject section */
Expand All @@ -178,6 +246,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
242BF2422BBC600D00E4D112 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -191,8 +260,28 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
242BF2622BBDA0CC00E4D112 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Run Script";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"${SRCROOT}/Scripts/build_xcframework.sh\"\n";
};
2430DEE72BB6B30700277123 /* Lint */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -217,6 +306,7 @@
buildActionMask = 2147483647;
files = (
2430DEA02BB5B53B00277123 /* SDDSIcons.docc in Sources */,
242BF24F2BBC687700E4D112 /* Assets.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -239,6 +329,24 @@
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
242BF25F2BBDA0C400E4D112 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = KDMYYG676V;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
242BF2602BBDA0C400E4D112 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = KDMYYG676V;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
2430DEAD2BB5B53B00277123 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -278,7 +386,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -345,7 +453,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down Expand Up @@ -378,15 +486,17 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = "${SRCROOT}/info.plist";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_PREPROCESS = NO;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
PRODUCT_BUNDLE_IDENTIFIER = com.sd.SDDSIcons;
Expand Down Expand Up @@ -414,15 +524,17 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = "${SRCROOT}/info.plist";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_PREPROCESS = NO;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
PRODUCT_BUNDLE_IDENTIFIER = com.sd.SDDSIcons;
Expand All @@ -441,6 +553,7 @@
2430DEB32BB5B53B00277123 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = KDMYYG676V;
Expand All @@ -461,6 +574,7 @@
2430DEB42BB5B53B00277123 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = KDMYYG676V;
Expand All @@ -481,6 +595,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
242BF2612BBDA0C400E4D112 /* Build configuration list for PBXAggregateTarget "Build XCFramework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
242BF25F2BBDA0C400E4D112 /* Debug */,
242BF2602BBDA0C400E4D112 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2430DE952BB5B53B00277123 /* Build configuration list for PBXProject "SDDSIcons" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
6 changes: 6 additions & 0 deletions SDDSIcons/SDDSIcons/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
45 changes: 45 additions & 0 deletions SDDSIcons/Scripts/build_xcframework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

PROJECT_ROOT_DIR="$(dirname "$0")/.."
PROJECT_ROOT_DIR=$(cd "$PROJECT_ROOT_DIR" && pwd)
echo "Root directory is ${PROJECT_ROOT_DIR}"

BUILD_FOLDER="build"
BUILD_PATH="${PROJECT_ROOT_DIR}/${BUILD_FOLDER}"

echo "Artefacts will appear in ${BUILD_PATH}"

rm -rf "${BUILD_PATH}"
mkdir -p "${BUILD_PATH}"

SCHEME="SDDSIcons"

echo "Building XCFrameworks for ${SCHEME}"

XCODE_PROJECT_PATH="${PROJECT_ROOT_DIR}/${SCHEME}.xcodeproj"

echo "Building XCFramework for the scheme $SCHEME"

echo "Making an archive for iOS device..."
iOS_ARCHIVE_PATH="${BUILD_PATH}/${SCHEME}-iphoneos.xcarchive"
SKIP_LINT=YES xcodebuild archive -project ${XCODE_PROJECT_PATH} -scheme ${SCHEME} -archivePath "${iOS_ARCHIVE_PATH}" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

echo "Making an archive for iOS simulator..."
iOS_SIMULATOR_ARCHIVE_PATH="${BUILD_PATH}/${SCHEME}-iossimulator.xcarchive"
SKIP_LINT=YES xcodebuild archive -project ${XCODE_PROJECT_PATH} -scheme ${SCHEME} -archivePath "${iOS_SIMULATOR_ARCHIVE_PATH}" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

echo "Making XCFramework..."
SKIP_LINT=YES xcodebuild -create-xcframework -framework "${BUILD_PATH}/${SCHEME}-iphoneos.xcarchive/Products/Library/Frameworks/${SCHEME}.framework" -framework "${BUILD_PATH}/${SCHEME}-iossimulator.xcarchive/Products/Library/Frameworks/${SCHEME}.framework" -output "${BUILD_PATH}/${SCHEME}.xcframework"

if [ $? -ne 0 ]; then
echo "Build failed for the scheme $SCHEME."
exit 1
else
echo "Build succeeded for the scheme $SCHEME"
fi

echo "Cleaning up archives..."
rm -rf "${iOS_ARCHIVE_PATH}"
rm -rf "${iOS_SIMULATOR_ARCHIVE_PATH}"

echo "All builds succeeded"
Loading

0 comments on commit f44a533

Please sign in to comment.