Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/danielgindi/Charts
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/danielgindi/Charts: (34 commits)
  Fixed X-Axis Labels Not Showing (ChartsOrg#3154) (ChartsOrg#3174)
  fix programatical unhighlighting for BarCharView (ChartsOrg#3159)
  Give the users customizable axis label limits (Fixes ChartsOrg#2085) (ChartsOrg#2894)
  bump pod version
  chart views now use open legend renderer property instead of internal one (ChartsOrg#3149)
  Fix axis label disappear when zooming in deep enough (ChartsOrg#3132)
  added DataApproximator+N extension (ChartsOrg#2848)
  Minor cleanup to Highlighter types (ChartsOrg#3003)
  Refactored ChartUtils method into CGPoint extension (ChartsOrg#3087)
  Update ViewPortHandler.swift (ChartsOrg#3143)
  add option to build demo projects unit tests on iOS (ChartsOrg#3121)
  Replaced relevant `ChartUtils` methods with `Double` extensions (ChartsOrg#2994)
  Update 4.0.0 with master (ChartsOrg#3135)
  Removed redundant ivars in BarLineChartViewBase (ChartsOrg#3043)
  fix ChartsOrg#1830. credit from ChartsOrg#2049 (ChartsOrg#2874)
  Makes ChartsDemo compiling again (ChartsOrg#3117)
  Fixed using wrong axis (Issue ChartsOrg#2257)
  Removed methods and properties deprecated in 1.0 (ChartsOrg#2996)
  for ChartsOrg#3061 revert animationUpdate() and animationEnd() not trigger crash if subclass does nothing
  The backing var is not necessary. (ChartsOrg#3000)
  ...

# Conflicts:
#	Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift
#	Source/Charts/Highlight/BarHighlighter.swift
#	Source/Charts/Renderers/BarChartRenderer.swift
  • Loading branch information
FreddyZeng committed Jan 20, 2018
2 parents 821120e + 43ccf8e commit 84123e9
Show file tree
Hide file tree
Showing 91 changed files with 1,292 additions and 1,908 deletions.
2 changes: 1 addition & 1 deletion Charts.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Charts"
s.version = "3.0.4"
s.version = "3.0.5"
s.summary = "Charts is a powerful & easy to use chart library for iOS, tvOS and OSX (and Android)"
s.homepage = "https://github.com/danielgindi/Charts"
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
Expand Down
12 changes: 12 additions & 0 deletions Charts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
17E994DA88777AA1D8CCFC58 /* BarChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C31AA65EA27776F8C653C7E8 /* BarChartDataSet.swift */; };
203A39685CC96FC625F616E4 /* IHighlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998F2BFE318471AFC05B50AC /* IHighlighter.swift */; };
219192CA6B4895319AB49DCA /* BarLineScatterCandleBubbleRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B1C588E9DF6FFD56D7ADF8E /* BarLineScatterCandleBubbleRenderer.swift */; };
224EFF991FBAAC4700CF9B3B /* EquatableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 224EFF981FBAAC4700CF9B3B /* EquatableTests.swift */; };
23649EFC635A76022F07FFA6 /* PieChartDataEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD02157CF8CEE1189BF681DA /* PieChartDataEntry.swift */; };
23FA50B2730D8C7ACA091C4F /* BarChartRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F279974FE650E57A061B09 /* BarChartRenderer.swift */; };
24151B0729D77251A8494D70 /* LineRadarRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 105FFC9D3773A9C7A60A897F /* LineRadarRenderer.swift */; };
Expand Down Expand Up @@ -98,6 +99,7 @@
967EE2EDDE3337C5C4337C59 /* IndexAxisValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10DD0A02E3CF611BD11EBA9B /* IndexAxisValueFormatter.swift */; };
97E033CC0ABEF0F448DAFA8E /* DataApproximator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93EF9709CF635BEE70D1ABC5 /* DataApproximator.swift */; };
98E2EEF45E8933E4AD182D58 /* ChartViewBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30EFAD7920F76360ADB3B5F5 /* ChartViewBase.swift */; };
9A26C8DB1F87B01700367599 /* DataApproximator+N.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A26C8DA1F87B01700367599 /* DataApproximator+N.swift */; };
9C91C151608E2D6E19B1EAD1 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F099502DA50C56204E7B744 /* Range.swift */; };
9F760570BCECB0BF5727AF90 /* BarLineChartViewBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45C6D3723C4E001B119CA0C8 /* BarLineChartViewBase.swift */; };
A40ACF0CCE96EEE104B0463D /* IValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EAA8AA30C377D54D22A577A /* IValueFormatter.swift */; };
Expand All @@ -107,6 +109,7 @@
B0D28C68BB9A958DC56EB214 /* DefaultValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 107D8F8163EE54D6D9E916B0 /* DefaultValueFormatter.swift */; };
B13C74B4FF705D7B595D01EF /* IAxisValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BD9DF16AF59680A3BB49452 /* IAxisValueFormatter.swift */; };
B539114951455C35BADAE3F3 /* PieChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4FB5E3761EF8B4D1E1E1014 /* PieChartDataSet.swift */; };
B6BF9A561F91993A00E62A5D /* CombinedChartTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6BF9A551F91993A00E62A5D /* CombinedChartTests.swift */; };
B6C9F450D937B87224D29D5C /* IFillFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 818AC6B12505B7C0A53D62F9 /* IFillFormatter.swift */; };
B6DCC229615EFE706F64A37D /* LineScatterCandleRadarRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 923206233CA89FD03565FF87 /* LineScatterCandleRadarRenderer.swift */; };
B85DEB06B4C1AFFC8A0E3295 /* CircleShapeRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECE1B1623D3AF69CECAE8562 /* CircleShapeRenderer.swift */; };
Expand Down Expand Up @@ -182,6 +185,7 @@
1F3D55A7E6176D52DC957D27 /* XAxisRendererHorizontalBarChart.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XAxisRendererHorizontalBarChart.swift; path = Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift; sourceTree = "<group>"; };
2194AA554712E6BA2677F114 /* BubbleChartRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartRenderer.swift; path = Source/Charts/Renderers/BubbleChartRenderer.swift; sourceTree = "<group>"; };
219BC9CEA037F897E92E45D1 /* IScatterChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IScatterChartDataSet.swift; path = Source/Charts/Data/Interfaces/IScatterChartDataSet.swift; sourceTree = "<group>"; };
224EFF981FBAAC4700CF9B3B /* EquatableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = EquatableTests.swift; path = Tests/Charts/EquatableTests.swift; sourceTree = "<group>"; };
23D35CF6F9177D77B6B97AE1 /* XShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/XShapeRenderer.swift; sourceTree = "<group>"; };
2440DB759AB93B4A928A3F6F /* RadarChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarChartView.swift; path = Source/Charts/Charts/RadarChartView.swift; sourceTree = "<group>"; };
2465CB73738EBAFB46C57288 /* CombinedHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombinedHighlighter.swift; path = Source/Charts/Highlight/CombinedHighlighter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -252,6 +256,7 @@
9249AD9AEC8C85772365A128 /* ILineScatterCandleRadarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ILineScatterCandleRadarChartDataSet.swift; path = Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift; sourceTree = "<group>"; };
93EF9709CF635BEE70D1ABC5 /* DataApproximator.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DataApproximator.swift; path = Source/Charts/Filters/DataApproximator.swift; sourceTree = "<group>"; };
998F2BFE318471AFC05B50AC /* IHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IHighlighter.swift; path = Source/Charts/Highlight/IHighlighter.swift; sourceTree = "<group>"; };
9A26C8DA1F87B01700367599 /* DataApproximator+N.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "DataApproximator+N.swift"; path = "Source/Charts/Filters/DataApproximator+N.swift"; sourceTree = "<group>"; };
9D7184C8A5A60A3522AB9B05 /* BarChartDataProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BarChartDataProvider.swift; path = Source/Charts/Interfaces/BarChartDataProvider.swift; sourceTree = "<group>"; };
9DCD13D558BA177D5952AD66 /* PieChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PieChartView.swift; path = Source/Charts/Charts/PieChartView.swift; sourceTree = "<group>"; };
9E7C673B9ED4340F550A9283 /* LegendEntry.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LegendEntry.swift; path = Source/Charts/Components/LegendEntry.swift; sourceTree = "<group>"; };
Expand All @@ -264,6 +269,7 @@
B137428B41C143D5115726C4 /* Description.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Description.swift; path = Source/Charts/Components/Description.swift; sourceTree = "<group>"; };
B1BA6B21CBDF77A15848994F /* RadarChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RadarChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift; sourceTree = "<group>"; };
B44829AF0ADA583F1F0279B7 /* BubbleChartDataSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BubbleChartDataSet.swift; path = Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift; sourceTree = "<group>"; };
B6BF9A551F91993A00E62A5D /* CombinedChartTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CombinedChartTests.swift; path = Tests/Charts/CombinedChartTests.swift; sourceTree = "<group>"; };
BA157EFF2F952192C11DF937 /* AnimatedMoveViewJob.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnimatedMoveViewJob.swift; path = Source/Charts/Jobs/AnimatedMoveViewJob.swift; sourceTree = "<group>"; };
BA1A58428DC4780BAB4EAADC /* CandleStickChartView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CandleStickChartView.swift; path = Source/Charts/Charts/CandleStickChartView.swift; sourceTree = "<group>"; };
BC19DC2434D65FFB446A61B7 /* XAxisRendererRadarChart.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = XAxisRendererRadarChart.swift; path = Source/Charts/Renderers/XAxisRendererRadarChart.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -510,7 +516,9 @@
isa = PBXGroup;
children = (
5C3F5E1A69EC06E86505F7B1 /* BarChartTests.swift */,
224EFF981FBAAC4700CF9B3B /* EquatableTests.swift */,
7AB9062A28AAB9469752A954 /* ChartUtilsTests.swift */,
B6BF9A551F91993A00E62A5D /* CombinedChartTests.swift */,
D2E1819D72CD7B6C4A4E8048 /* LineChartTests.swift */,
064989451F5C99C7006E8BB3 /* Snapshot.swift */,
);
Expand All @@ -530,6 +538,7 @@
isa = PBXGroup;
children = (
93EF9709CF635BEE70D1ABC5 /* DataApproximator.swift */,
9A26C8DA1F87B01700367599 /* DataApproximator+N.swift */,
);
name = Filters;
sourceTree = "<group>";
Expand Down Expand Up @@ -852,6 +861,7 @@
0C52C70C6E6EA09BD7426386 /* RadarChartData.swift in Sources */,
C2EFB4EC8C97FA9987F1B50D /* RadarChartDataEntry.swift in Sources */,
E3B28EA1E21279DF3889BCE8 /* RadarChartDataSet.swift in Sources */,
9A26C8DB1F87B01700367599 /* DataApproximator+N.swift in Sources */,
2B791E64E7C4523B1A63F72A /* ScatterChartData.swift in Sources */,
EB56849433A76B08606B73EB /* ScatterChartDataSet.swift in Sources */,
C3F0DDB7F0A922F0BB7EDB8A /* IBarChartDataSet.swift in Sources */,
Expand Down Expand Up @@ -943,8 +953,10 @@
files = (
3B11556EB7DC034E2FC958E4 /* BarChartTests.swift in Sources */,
8E1192F7A7152E9DA92C56A9 /* ChartUtilsTests.swift in Sources */,
B6BF9A561F91993A00E62A5D /* CombinedChartTests.swift in Sources */,
2BF85BEA981B359A65E9BF67 /* LineChartTests.swift in Sources */,
064989461F5C99C7006E8BB3 /* Snapshot.swift in Sources */,
224EFF991FBAAC4700CF9B3B /* EquatableTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
4 changes: 2 additions & 2 deletions ChartsDemo/Objective-C/Demos/CombinedChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ - (BarChartData *)generateBarData
[set1 setColor:[UIColor colorWithRed:60/255.f green:220/255.f blue:78/255.f alpha:1.f]];
set1.valueTextColor = [UIColor colorWithRed:60/255.f green:220/255.f blue:78/255.f alpha:1.f];
set1.valueFont = [UIFont systemFontOfSize:10.f];
set1.axisDependency = AxisDependencyLeft;
set1.axisDependency = AxisDependencyRight;

BarChartDataSet *set2 = [[BarChartDataSet alloc] initWithValues:entries2 label:@""];
set2.stackLabels = @[@"Stack 1", @"Stack 2"];
Expand All @@ -226,7 +226,7 @@ - (BarChartData *)generateBarData
];
set2.valueTextColor = [UIColor colorWithRed:61/255.f green:165/255.f blue:255/255.f alpha:1.f];
set2.valueFont = [UIFont systemFontOfSize:10.f];
set2.axisDependency = AxisDependencyLeft;
set2.axisDependency = AxisDependencyRight;

float groupSpace = 0.06f;
float barSpace = 0.02f; // x2 dataset
Expand Down
2 changes: 1 addition & 1 deletion ChartsDemo/Objective-C/Demos/HalfPieChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleXValues"])
{
_chartView.drawSliceTextEnabled = !_chartView.isDrawSliceTextEnabled;
_chartView.drawEntryLabelsEnabled = !_chartView.drawEntryLabelsEnabled;

[_chartView setNeedsDisplay];
return;
Expand Down
9 changes: 8 additions & 1 deletion ChartsDemo/Objective-C/Demos/LineChart1ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,14 @@ - (void)optionTapped:(NSString *)key
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
{
set.drawSteppedEnabled = !set.isDrawSteppedEnabled;
switch (set.mode) {
case LineChartModeLinear:
case LineChartModeCubicBezier:
case LineChartModeHorizontalBezier:
set.mode = LineChartModeStepped;
break;
case LineChartModeStepped: set.mode = LineChartModeLinear;
}
}

[_chartView setNeedsDisplay];
Expand Down
9 changes: 8 additions & 1 deletion ChartsDemo/Objective-C/Demos/LineChart2ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,14 @@ - (void)optionTapped:(NSString *)key
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
{
set.drawSteppedEnabled = !set.isDrawSteppedEnabled;
switch (set.mode) {
case LineChartModeLinear:
case LineChartModeCubicBezier:
case LineChartModeHorizontalBezier:
set.mode = LineChartModeStepped;
break;
case LineChartModeStepped: set.mode = LineChartModeLinear;
}
}

[_chartView setNeedsDisplay];
Expand Down
9 changes: 8 additions & 1 deletion ChartsDemo/Objective-C/Demos/LineChartTimeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ - (void)optionTapped:(NSString *)key
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
{
set.drawSteppedEnabled = !set.isDrawSteppedEnabled;
switch (set.mode) {
case LineChartModeLinear:
case LineChartModeCubicBezier:
case LineChartModeHorizontalBezier:
set.mode = LineChartModeStepped;
break;
case LineChartModeStepped: set.mode = LineChartModeLinear;
}
}

[_chartView setNeedsDisplay];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,14 @@ - (void)optionTapped:(NSString *)key
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
{
set.drawSteppedEnabled = !set.isDrawSteppedEnabled;
switch (set.mode) {
case LineChartModeLinear:
case LineChartModeCubicBezier:
case LineChartModeHorizontalBezier:
set.mode = LineChartModeStepped;
break;
case LineChartModeStepped: set.mode = LineChartModeLinear;
}
}

[_chartView setNeedsDisplay];
Expand Down
2 changes: 1 addition & 1 deletion ChartsDemo/Objective-C/Demos/PieChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleXValues"])
{
_chartView.drawSliceTextEnabled = !_chartView.isDrawSliceTextEnabled;
_chartView.drawEntryLabelsEnabled = !_chartView.drawEntryLabelsEnabled;

[_chartView setNeedsDisplay];
return;
Expand Down
2 changes: 2 additions & 0 deletions ChartsDemo/Swift/Components/BalloonMarker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public class BalloonMarker: MarkerImage {
y: rect.origin.y))
context.fillPath()

rect.origin.x += self.insets.left
rect.origin.y += self.insets.top
rect.size.width -= self.insets.left + self.insets.right
rect.size.height -= self.insets.top + self.insets.bottom

UIGraphicsPushContext(context)
Expand Down
64 changes: 49 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ def type
end

def project_name
'Charts.xcodeproj'
'ChartsDemo/ChartsDemo.xcodeproj'
end

def macos_project_name
'ChartsDemo-OSX/ChartsDemo-OSX.xcodeproj'
end

def configuration
Expand All @@ -29,6 +33,19 @@ def build_schemes
]
end

def build_demo_schemes
%i[
ChartsDemo
ChartsDemo-Swift
]
end

def build_macos_demo_schemes
[
'ChartsDemo-OSX'
]
end

def test_schemes
[
'ChartsTests'
Expand Down Expand Up @@ -74,33 +91,43 @@ def xcodebuild(type, name, scheme, configuration, sdk, destination, tasks, xcpre
sh "set -o pipefail && xcodebuild #{project_type} '#{name}' -scheme '#{scheme}' -configuration '#{configuration}' -sdk #{sdk} -destination #{destination} #{tasks} | bundle exec xcpretty -c #{xcprety_args}"
end

def run_xcodebuild(schemes_to_execute, tasks, destination, is_test, xcprety_args)
def run_xcodebuild(tasks, destination, is_build_demo, xcprety_args)
sdk = destination[:sdk]
device = destination[:device]
uuid = destination[:uuid]

is_test = tasks.include?('test')
is_macos = sdk == 'macosx'

project = is_macos ? macos_project_name : project_name

schemes_to_execute = []
if is_test
schemes_to_execute = test_schemes
elsif is_build_demo
schemes_to_execute = is_macos ? build_macos_demo_schemes : build_demo_schemes
else
schemes_to_execute = build_schemes
end

open_simulator_and_sleep uuid if is_test

schemes_to_execute.each do |scheme|
xcodebuild type, project_name, scheme, configuration, sdk, device, tasks, xcprety_args
xcodebuild type, project, scheme, configuration, sdk, device, tasks, xcprety_args
end
end

def execute(tasks, platform, xcprety_args: '')
is_test = tasks.include?('test')

def execute(tasks, platform, is_build_demo = false, xcprety_args: '')
# platform specific settings
destination = devices[platform]

schemes = is_test ? test_schemes : build_schemes

# check if xcodebuild needs to be run on multiple devices
if destination.is_a?(Array)
destination.each do |destination|
run_xcodebuild schemes, tasks, destination, is_test, xcprety_args
run_xcodebuild tasks, destination, is_build_demo, xcprety_args
end
else
run_xcodebuild schemes, tasks, destination, is_test, xcprety_args
run_xcodebuild tasks, destination, is_build_demo, xcprety_args
end
end

Expand All @@ -122,11 +149,18 @@ end
desc 'Run CI tasks. Build and test or build depending on the platform.'
task :ci, [:platform] do |_task, args|
platform = arg_to_key(args[:platform]) if args.key?(:platform)

if test_platforms.include?(platform)
execute 'clean test', platform
elsif build_platforms.include?(platform)
execute 'clean build', platform
is_build_demo = test_platforms.include?(platform) || build_platforms.include?(platform)

if test_platforms.include?(platform) # iOS and tvOS
if platform == :iOS
execute 'clean', platform, is_build_demo
execute 'build', platform, is_build_demo
execute 'test', platform # not use demo specifically
else
execute 'clean test', platform
end
elsif build_platforms.include?(platform) # macOS
execute 'clean build', platform, is_build_demo
else
test_platforms.each do |platform|
execute 'clean test', platform
Expand Down
Loading

0 comments on commit 84123e9

Please sign in to comment.