Skip to content

Commit

Permalink
HUF-118 Framework setup (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Alex77 authored and Philip Kramer committed Nov 19, 2017
1 parent 9745972 commit 8cbfb3b
Show file tree
Hide file tree
Showing 47 changed files with 2,510 additions and 1,084 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0
52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
language: objective-c
osx_image: xcode9
branches:
only:
- master
env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- WORKSPACE=OML10n.xcworkspace
- IOS_FRAMEWORK_SCHEME="OML10n"
- EXAMPLE_SCHEME="Example"
matrix:
- DESTINATION="OS=11.0,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="YES" POD_LINT="YES"
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="YES" POD_LINT="NO"
- DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="YES" POD_LINT="NO"

before_install:
- gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet
- pod repo update

script:
- set -o pipefail
- xcodebuild -version
- xcodebuild -showsdks

# Build Framework in Debug and Run Tests if specified
- if [ $RUN_TESTS == "YES" ]; then
xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
else
xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi

# Build Framework in Release and Run Tests if specified
- if [ $RUN_TESTS == "YES" ]; then
xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
else
xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi

# Build Example in Debug if specified
- if [ $BUILD_EXAMPLE == "YES" ]; then
xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi

# Run `pod lib lint` if specified
- if [ $POD_LINT == "YES" ]; then
pod lib lint;
fi

after_success:
- bash <(curl -s https://codecov.io/bash)
8 changes: 8 additions & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target 'Example' do
pod 'OML10n', :git => "https://github.com/OnMap/OML10n-iOS.git"

end
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
6 changes: 6 additions & 0 deletions Example/Resources/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Default-568h@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 15 additions & 8 deletions LocalizationTest/Info.plist → Example/Resources/Info.plist
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,41 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<string>OML10n</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarTintParameters</key>
<dict>
<key>UINavigationBar</key>
<dict>
<key>Style</key>
<string>UIBarStyleDefault</string>
<key>Translucent</key>
<false/>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
File renamed without changes.
223 changes: 223 additions & 0 deletions Example/Resources/Main.storyboard

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
Localizable.strings
LocalizationTest
LocalizationExample

Created by Alex Alexandrovych on 16/08/2017.
Copyright © 2017 Alex Alexandrovych. All rights reserved.
*/

"Main.Label" = "";
"Main.CodeLabel" = "english text";
"Main.ChangeLanguageButton.Normal" = "normal bla button";
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
Localizable.strings
LocalizationTest
LocalizationExample

Created by Alex Alexandrovych on 16/08/2017.
Copyright © 2017 Alex Alexandrovych. All rights reserved.
*/

"Main.Label" = "text";
"Main.CodeLabel" = "hebrew text";
"Main.ChangeLanguageButton.Normal" = "normal bla button";
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/*
Localizable.strings
LocalizationTest
LocalizationExample

Created by Alex Alexandrovych on 16/08/2017.
Copyright © 2017 Alex Alexandrovych. All rights reserved.
*/
"Main.Label" = "russian text";

"Main.CodeLabel" = "russian text";
"Main.ChangeLanguageButton.Normal" = "normal bla button";
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//
// AppDelegate.swift
// LocalizationTest
// LocalizationExample
//
// Created by Alex Alexandrovych on 16/08/2017.
// Copyright © 2017 Alex Alexandrovych. All rights reserved.
//

import UIKit
import OML10n

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -23,7 +24,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Localization.setupCurrentLanguage()
LiveUpdatingService.setup()
let appId = "f635ba15-0adf-42bc-b13e-88499a433f37"
LiveUpdatesNetworkService.setup(appId: appId)
return true
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//
// LanguageSelectVC.swift
// OnMap
// LocalizationExample
//
// Created by Philip Kramer on 24/12/2016.
// Copyright © 2016 OnMap LTD. All rights reserved.
//

import UIKit
import OML10n

class LanguageSelectVC: UIViewController {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/*
Localizable.strings
LocalizationTest
LocalizationExample

Created by Alex Alexandrovych on 16/08/2017.
Copyright © 2017 Alex Alexandrovych. All rights reserved.
*/
"Main.Label" = "hebrew text";

"Main.CodeLabel" = "english text";
"Main.ChangeLanguageButton.Normal" = "normal bla button";
42 changes: 42 additions & 0 deletions Example/Source/MainVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// MainVC.swift
// LocalizationExample
//
// Created by Alex Alexandrovych on 16/08/2017.
// Copyright © 2017 Alex Alexandrovych. All rights reserved.
//

import UIKit
import RxSwift
import OML10n

class MainVC: UIViewController {

// MARK: - Properties

@IBOutlet private weak var storyboardLabel: UILabel!

private lazy var codeLabel: UILabel = {
let label = UILabel()
label.text = "I'm a button created programmatically"
label.localizationKey = "Main.CodeLabel"
label.textAlignment = .center
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()

// MARK: - Life cycle

override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(codeLabel)
NSLayoutConstraint.activate([
codeLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor),
codeLabel.topAnchor.constraint(equalTo: storyboardLabel.bottomAnchor, constant: 50)
])

LiveUpdates.listenUpdates(for: self)
}

}

Loading

0 comments on commit 8cbfb3b

Please sign in to comment.