"""
add """
+ 0FDD07A21C6F8E0E006FF70E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0FDD07A11C6F8E0E006FF70E /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
-/* Begin PBXContainerItemProxy section */
- AF9F83EA1A5F0D21004B62C0 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = AF9F83C41A5F0D21004B62C0 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = AF9F83CB1A5F0D21004B62C0;
- remoteInfo = {{{name}}};
- };
-/* End PBXContainerItemProxy section */
-
/* Begin PBXFileReference section */
/* Static generated files */
AF9F83CC1A5F0D21004B62C0 /* {{{name}}}.app */ = {
path = Base.lproj/LaunchScreen.xib;
sourceTree = "<group>";
};
- AF9F83E91A5F0D21004B62C0 /* {{{name}}}Tests.xctest */ = {
- isa = PBXFileReference;
- explicitFileType = wrapper.cfbundle;
- includeInIndex = 0;
- path = {{{name}}}Tests.xctest;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- AF9F83EE1A5F0D21004B62C0 /* Info.plist */ = {
- isa = PBXFileReference;
- lastKnownFileType = text.plist.xml;
- path = Info.plist;
- sourceTree = "<group>";
- };
- AF9F83EF1A5F0D21004B62C0 /* {{{name}}}Tests.m */ = {
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = {{{name}}}Tests.m;
- sourceTree = "<group>";
- };
/* Changing generated files */
"""
for file in files do add file.description
add """
+ 0FDD07A11C6F8E0E006FF70E /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
);
runOnlyForDeploymentPostprocessing = 0;
};
- AF9F83E61A5F0D21004B62C0 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
isa = PBXGroup;
children = (
AF9F83CE1A5F0D21004B62C0 /* {{{name}}} */,
- AF9F83EC1A5F0D21004B62C0 /* {{{name}}}Tests */,
AF9F83CD1A5F0D21004B62C0 /* Products */,
+ 0FDD07A11C6F8E0E006FF70E /* LaunchScreen.storyboard */,
);
sourceTree = "<group>";
};
isa = PBXGroup;
children = (
AF9F83CC1A5F0D21004B62C0 /* {{{name}}}.app */,
- AF9F83E91A5F0D21004B62C0 /* {{{name}}}Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
path = {{{name}}};
sourceTree = "<group>";
};
- AF9F83CF1A5F0D21004B62C0 /* Supporting Files */ = {
- isa = PBXGroup;
- children = (
- AF9F83D01A5F0D21004B62C0 /* Info.plist */,
- AF9F83D11A5F0D21004B62C0 /* main.m */,
- );
- name = "Supporting Files";
- sourceTree = "<group>";
- };
- AF9F83EC1A5F0D21004B62C0 /* {{{name}}}Tests */ = {
- isa = PBXGroup;
- children = (
- AF9F83EF1A5F0D21004B62C0 /* {{{name}}}Tests.m */,
- AF9F83ED1A5F0D21004B62C0 /* Supporting Files */,
- );
- path = {{{name}}}Tests;
- sourceTree = "<group>";
- };
- AF9F83ED1A5F0D21004B62C0 /* Supporting Files */ = {
- isa = PBXGroup;
- children = (
- AF9F83EE1A5F0D21004B62C0 /* Info.plist */,
- );
- name = "Supporting Files";
- sourceTree = "<group>";
- };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
productReference = AF9F83CC1A5F0D21004B62C0 /* {{{name}}}.app */;
productType = "com.apple.product-type.application";
};
- AF9F83E81A5F0D21004B62C0 /* {{{name}}}Tests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = AF9F83F61A5F0D21004B62C0 /* Build configuration list for PBXNativeTarget "{{{name}}}Tests" */;
- buildPhases = (
- AF9F83E51A5F0D21004B62C0 /* Sources */,
- AF9F83E61A5F0D21004B62C0 /* Frameworks */,
- AF9F83E71A5F0D21004B62C0 /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- AF9F83EB1A5F0D21004B62C0 /* PBXTargetDependency */,
- );
- name = {{{name}}}Tests;
- productName = {{{name}}}Tests;
- productReference = AF9F83E91A5F0D21004B62C0 /* {{{name}}}Tests.xctest */;
- productType = "com.apple.product-type.bundle.unit-test";
- };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
AF9F83CB1A5F0D21004B62C0 = {
CreatedOnToolsVersion = 6.1.1;
};
- AF9F83E81A5F0D21004B62C0 = {
- CreatedOnToolsVersion = 6.1.1;
- TestTargetID = AF9F83CB1A5F0D21004B62C0;
- };
};
};
buildConfigurationList = AF9F83C71A5F0D21004B62C0 /* Build configuration list for PBXProject "{{{name}}}" */;
projectRoot = "";
targets = (
AF9F83CB1A5F0D21004B62C0 /* {{{name}}} */,
- AF9F83E81A5F0D21004B62C0 /* {{{name}}}Tests */,
);
};
/* End PBXProject section */
"""
add """
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- AF9F83E71A5F0D21004B62C0 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
+ 0FDD07A21C6F8E0E006FF70E /* LaunchScreen.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
);
runOnlyForDeploymentPostprocessing = 0;
};
- AF9F83E51A5F0D21004B62C0 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- AF9F83F01A5F0D21004B62C0 /* {{{name}}}Tests.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
/* End PBXSourcesBuildPhase section */
-/* Begin PBXTargetDependency section */
- AF9F83EB1A5F0D21004B62C0 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = AF9F83CB1A5F0D21004B62C0 /* {{{name}}} */;
- targetProxy = AF9F83EA1A5F0D21004B62C0 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin PBXVariantGroup section */
- AF9F83DD1A5F0D21004B62C0 /* Main.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- AF9F83DE1A5F0D21004B62C0 /* Base */,
- );
- name = Main.storyboard;
- sourceTree = "<group>";
- };
- AF9F83E21A5F0D21004B62C0 /* LaunchScreen.xib */ = {
- isa = PBXVariantGroup;
- children = (
- AF9F83E31A5F0D21004B62C0 /* Base */,
- );
- name = LaunchScreen.xib;
- sourceTree = "<group>";
- };
-/* End PBXVariantGroup section */
-
/* Begin XCBuildConfiguration section */
AF9F83F11A5F0D21004B62C0 /* Debug */ = {
isa = XCBuildConfiguration;
};
name = Release;
};
- AF9F83F71A5F0D21004B62C0 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- INFOPLIST_FILE = {{{name}}}Tests/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- PRODUCT_NAME = "$(TARGET_NAME)";
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/{{{name}}}.app/{{{name}}}";
- };
- name = Debug;
- };
- AF9F83F81A5F0D21004B62C0 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
- INFOPLIST_FILE = {{{name}}}Tests/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- PRODUCT_NAME = "$(TARGET_NAME)";
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/{{{name}}}.app/{{{name}}}";
- };
- name = Release;
- };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
);
defaultConfigurationIsVisible = 0;
};
- AF9F83F61A5F0D21004B62C0 /* Build configuration list for PBXNativeTarget "{{{name}}}Tests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- AF9F83F71A5F0D21004B62C0 /* Debug */,
- AF9F83F81A5F0D21004B62C0 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- };
/* End XCConfigurationList section */
};
rootObject = AF9F83C41A5F0D21004B62C0 /* Project object */;
class PlistTemplate
super Template
- # Package of the app
- var package_name: String
+ # Value of CFBundleName, pretty name of the application
+ var product_name: String
+
+ # Value of CFBundleIdentifier, namespace of the app
+ var bundle_identifier: String
+
+ # Value of CFBundleShortVersionString, human readable version
+ var short_version: String
+
+ # Value of CFBundleVersion, often a revision number
+ var bundle_version: String
redef fun rendering
do
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
- <string>{{{package_name}}}.$(PRODUCT_NAME:rfc1034identifier)</string>
+ <string>{{{bundle_identifier}}}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>$(PRODUCT_NAME)</string>
+ <string>{{{product_name}}}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.0</string>
+ <string>{{{short_version}}}</string>
<key>CFBundleSignature</key>
- <string>\\?\\?\\?\\?</string>
+ <string>????</string>
<key>CFBundleVersion</key>
- <string>1</string>
+ <string>{{{bundle_version}}}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
+
+ <key>UILaunchStoryboardName</key>
+ <string>LaunchScreen</string>
+
+ <key>NSAppTransportSecurity</key>
+ <dict>
+ <key>NSAllowsArbitraryLoads</key><true/>
+ </dict>
</dict>
</plist>
"""
end
end
+
+# Template for the loading screen to generate `LaunchScreen.storyboard`
+class LaunchScreenStoryboardTemplate
+ super Template
+
+ # Large text to show in the center of the loading screen
+ var title = "" is writable
+
+ # Text to show at the bottom of the loading screen
+ var subtitle = "" is writable
+
+ # TODO make this more customizable by moving the subviews block as an attribute
+ # or by allowing to pass a custom file from the ` res/` folder.
+
+ redef fun rendering
+ do
+ add """
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
+ <dependencies>
+ <deployment identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
+ <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="EHf-IW-A2E">
+ <objects>
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
+ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="{{{subtitle}}}" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
+ <rect key="frame" x="20" y="559" width="560" height="21"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
+ <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="{{{title}}}" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
+ <rect key="frame" x="20" y="176" width="560" height="43"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
+ <color key="textColor" red="0.0" green="0.5" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
+ <constraint firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
+ <constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
+ <constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
+ <constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
+ <constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="x7j-FC-K8j"/>
+ </constraints>
+ </view>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="53" y="375"/>
+ </scene>
+ </scenes>
+</document>"""
+ end
+end