Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit f2dcc69

Browse files
committed
Fixed bug in csv reading
1 parent f192335 commit f2dcc69

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

ado-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "android-app-size-diff-utils",
44
"name": "Android app size changes",
5-
"version": "0.0.26",
5+
"version": "0.0.27",
66
"publisher": "PraveenPendyala",
77
"targets": [
88
{

dist_gh_action/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "android-app-size-diff",
3-
"version": "0.0.26",
3+
"version": "0.0.27",
44
"description": "Azure DevOps task to measure the size in Android app size by looking at 2 given APKs and AABs",
55
"main": "index.js",
66
"scripts": {
@@ -50,4 +50,4 @@
5050
"shelljs": "^0.8.3",
5151
"sync-request": "^6.1.0"
5252
}
53-
}
53+
}

src/apkAnalyzer/CiRunner.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class CiRunner {
6565
abortRun = true;
6666
}
6767

68-
const metricsList: Array<string> = metrics.split(',');
68+
const metricsList: Array<string> = this.readCsv(metrics);
6969
var thresholdsList: Array<number> = []
7070
try {
7171
thresholdsList = this.parseThresholdsFromInput(thresholds, metricsList);
@@ -114,7 +114,7 @@ export default class CiRunner {
114114
}
115115

116116
// Check if same number of thresholds and metrics are passed
117-
const thresholdStrings: Array<string> = thresholdsInput.split(',');
117+
const thresholdStrings: Array<string> = this.readCsv(thresholdsInput);
118118
if (thresholdStrings.length != metricsList.length) {
119119
throw 'Thresholds must be set corresponding to each metric in metrics or none!';
120120
}
@@ -127,5 +127,9 @@ export default class CiRunner {
127127
return thresholdsList;
128128
}
129129

130+
private readCsv(inputString: string): Array<string> {
131+
const valuesList: Array<string> = inputString.split(',');
132+
return valuesList.map((value) => value.trim());
133+
}
130134

131135
}

src/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"version": {
1111
"Major": 0,
1212
"Minor": 0,
13-
"Patch": 26
13+
"Patch": 27
1414
},
1515
"instanceNameFormat": "Android App size change - $(baseAppPath) vs $(targetAppPath)",
1616
"inputs": [

0 commit comments

Comments
 (0)