Skip to content

Commit e3dd7af

Browse files
committed
Merge branch 'feature/integration-features' into develop
2 parents a47732b + 45361ea commit e3dd7af

File tree

8 files changed

+241
-108
lines changed

8 files changed

+241
-108
lines changed

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
language: objective-c
2+
osx_image: xcode8.3
3+
#xcode_project: ViewModelKit.xcodeproj
4+
xcode_workspace: ViewModelKit.xcworkspace
5+
xcode_scheme: ViewModelKit
6+
xcode_sdk: iphonesimulator10.3
7+
env:
8+
global:
9+
- FRAMEWORK_NAME=ViewModelKit
10+
before_install:
11+
- brew update
12+
- brew outdated carthage || brew upgrade carthage
13+
- brew outdated xctool || brew upgrade xctool
14+
- pip install --user cpp-coveralls
15+
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
16+
before_script:
17+
- carthage bootstrap
18+
script:
19+
- set -o pipefail;
20+
- xcodebuild test -project ViewModelKit.xcodeproj -scheme ViewModelKit -sdk iphonesimulator -destination "platform=iOS Simulator,OS=latest,name=iPhone 5" | xcpretty
21+
- xcodebuild test -project ViewModelKit.xcodeproj -scheme ViewModelKit -sdk iphonesimulator -destination "platform=iOS Simulator,OS=latest,name=iPhone 5s" | xcpretty
22+
before_deploy:
23+
- carthage build --no-skip-current
24+
- carthage archive $FRAMEWORK_NAME
25+
after_success:
26+
- ./Cocoanetics-Ruby/coveralls.rb --exclude-folder ViewModelKitTests --exclude-folder Carthage --exclude-folder docs --exclude-folder VMKExample

Cocoanetics-Ruby/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.gem
2+
*.rbc
3+
.bundle
4+
.config
5+
coverage
6+
InstalledFiles
7+
lib/bundler/man
8+
pkg
9+
rdoc
10+
spec/reports
11+
test/tmp
12+
test/version_tmp
13+
tmp
14+
15+
# YARD artifacts
16+
.yardoc
17+
_yardoc
18+
doc/

Cocoanetics-Ruby/LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2013, Oliver Drobnik
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
Redistributions in binary form must reproduce the above copyright notice, this
11+
list of conditions and the following disclaimer in the documentation and/or
12+
other materials provided with the distribution.
13+
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
18+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Cocoanetics-Ruby/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Cocoanetics Ruby
2+
================
3+
4+
Collection of my Ruby Scripts
5+
6+
###Coveralls.rb
7+
8+
This script finds all **.gcda** files unterneath the current user's DerivedData folder. Since you get a fresh VM every time Travis-CI builds those should be the ones that you also want to submit.
9+
10+
Submission is done with [cpp_coveralls](https://github.com/eddyxu/cpp-coveralls)
11+
12+
The script has a few options of which -x and -e are passed onto cpp_coveralls. Typically you want to limit processing to **m** extension for Objective-C projects.
13+
14+
Usage: coveralls.rb [options]
15+
-e, --exclude-folder FOLDER Folder to exclude
16+
-h, --exclude-headers Ignores headers
17+
-x, --extension EXT Source file extension to process
18+
-?, --help Show this message
19+
20+
Example `**.travis.yml**`
21+
22+
---
23+
language: objective-c
24+
25+
before_script:
26+
- sudo easy_install cpp-coveralls
27+
28+
script:
29+
- xctool -project DTFoundation.xcodeproj -scheme "Static Library" build test -sdk iphonesimulator
30+
31+
after_success:
32+
- ./coveralls.rb --extension m --exclude-folder Demo --exclude-folder Test --exclude-folder Externals
33+

Cocoanetics-Ruby/coveralls.rb

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'etc'
4+
require 'fileutils'
5+
require 'find'
6+
require 'optparse'
7+
8+
# arraw of source subfolders to exclude
9+
excludedFolders = []
10+
extensionsToProcess = []
11+
coveralls_cmd = "coveralls"
12+
13+
excludeHeaders = false
14+
15+
# create option parser
16+
opts = OptionParser.new
17+
opts.banner = "Usage: coveralls.rb [options]"
18+
19+
opts.on('-e', '--exclude-folder FOLDER', 'Folder to exclude') do |v|
20+
excludedFolders << v
21+
coveralls_cmd.concat(" -e #{v}")
22+
end
23+
24+
opts.on('-h', '--exclude-headers', 'Ignores headers') do |v|
25+
excludeHeaders = true
26+
end
27+
28+
opts.on('-x', '--extension EXT', 'Source file extension to process') do |v|
29+
extensionsToProcess << v
30+
coveralls_cmd.concat(" -x #{v}")
31+
end
32+
33+
opts.on_tail("-?", "--help", "Show this message") do
34+
puts opts
35+
exit
36+
end
37+
38+
# parse the options
39+
begin
40+
opts.parse!(ARGV)
41+
rescue OptionParser::InvalidOption => e
42+
puts e
43+
puts opts
44+
exit(1)
45+
end
46+
47+
# the folders
48+
workingDir = Dir.getwd
49+
derivedDataDir = "#{Etc.getpwuid.dir}/Library/Developer/Xcode/DerivedData/"
50+
outputDir = workingDir + "/gcov"
51+
52+
# create gcov output folder
53+
FileUtils.mkdir outputDir
54+
55+
# pattern to get source file from first line of gcov file
56+
GCOV_SOURCE_PATTERN = Regexp.new(/Source:(.*)/)
57+
58+
# enumerate all gcda files underneath derivedData
59+
Find.find(derivedDataDir) do |gcda_file|
60+
61+
if gcda_file.match(/\.gcda\Z/)
62+
63+
#get just the folder name
64+
gcov_dir = File.dirname(gcda_file)
65+
66+
# cut off absolute working dir to get relative source path
67+
relative_input_path = gcda_file.slice(derivedDataDir.length, gcda_file.length)
68+
puts "\nINPUT: #{relative_input_path}"
69+
70+
#process the file
71+
result = %x( gcov '#{gcda_file}' -o '#{gcov_dir}' )
72+
73+
# filter the resulting output
74+
Dir.glob("*.gcov") do |gcov_file|
75+
76+
firstLine = File.open(gcov_file).readline
77+
match = GCOV_SOURCE_PATTERN.match(firstLine)
78+
79+
if (match)
80+
81+
source_path = match[1]
82+
83+
puts "source: #{source_path} - #{workingDir}"
84+
85+
if (source_path.start_with? workingDir)
86+
87+
# cut off absolute working dir to get relative source path
88+
relative_path = source_path.slice(workingDir.length+1, source_path.length)
89+
90+
extension = File.extname(relative_path)
91+
extension = extension.slice(1, extension.length-1)
92+
93+
puts "#{extension}"
94+
95+
# get the path components
96+
path_comps = relative_path.split(File::SEPARATOR)
97+
98+
shouldProcess = false
99+
exclusionMsg =""
100+
101+
if (excludedFolders.include?(path_comps[0]))
102+
exclusionMsg = "excluded via option"
103+
else
104+
if (excludeHeaders == true && extension == 'h')
105+
exclusionMsg = "excluded header"
106+
else
107+
if (extensionsToProcess.count == 0 || extensionsToProcess.include?(extension))
108+
shouldProcess = true
109+
else
110+
exclusionMsg = "excluded extension"
111+
shouldProcess = false
112+
end
113+
end
114+
end
115+
116+
if (shouldProcess)
117+
puts " - process: #{relative_path}"
118+
FileUtils.mv(gcov_file, outputDir)
119+
else
120+
puts " - ignore: #{relative_path} (#{exclusionMsg})"
121+
FileUtils.rm gcov_file
122+
end
123+
else
124+
puts " - ignore: #{gcov_file} (outside source folder)"
125+
FileUtils.rm gcov_file
126+
end
127+
end
128+
end
129+
end
130+
end
131+
132+
#call the coveralls, exclude some files
133+
system coveralls_cmd
134+
135+
#clean up
136+
FileUtils.rm_rf outputDir

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ViewModelKit
22

3+
[![Build Status](https://travis-ci.org/Andrenalin/ViewModelKit.svg?branch=master)](https://travis-ci.org/Andrenalin/ViewModelKit)
4+
[![Coverage Status](https://coveralls.io/repos/github/Andrenalin/ViewModelKit/badge.svg)](https://coveralls.io/github/Andrenalin/ViewModelKit)
5+
[![codebeat badge](https://codebeat.co/badges/dc28778a-446d-4214-bffc-73789a3d4271)](https://codebeat.co/projects/github-com-andrenalin-viewmodelkit-develop)
36
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
47

58
MVVM for iOS with objective-c based on KVO.

VMKExample/VMKExample.xcodeproj/xcshareddata/xcschemes/VMKExample.xcscheme

Lines changed: 0 additions & 108 deletions
This file was deleted.

ViewModelKit.xcodeproj/xcshareddata/xcschemes/ViewModelKit.xcscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
enableAddressSanitizer = "YES"
3030
enableASanStackUseAfterReturn = "YES"
3131
enableUBSanitizer = "YES"
32+
language = ""
3233
shouldUseLaunchSchemeArgsEnv = "YES"
3334
codeCoverageEnabled = "YES">
3435
<Testables>
@@ -62,6 +63,7 @@
6263
enableAddressSanitizer = "YES"
6364
enableASanStackUseAfterReturn = "YES"
6465
enableUBSanitizer = "YES"
66+
language = ""
6567
launchStyle = "0"
6668
useCustomWorkingDirectory = "NO"
6769
ignoresPersistentStateOnLaunch = "NO"

0 commit comments

Comments
 (0)