diff --git a/circle.yml b/circle.yml index 2a7d1d80ece..aaebd15ca7c 100644 --- a/circle.yml +++ b/circle.yml @@ -141,4 +141,4 @@ jobs: - run: name: Check & Publish Binary Size command: | - ./scripts/check_binary_size.sh ./scripts/paths_file.txt ./scripts/labels_file.txt 'mapbox-navigation-android' 'android' ./scripts/platforms_file.txt \ No newline at end of file + ./scripts/check_binary_size.sh ./scripts/paths_file.txt ./scripts/labels_file.txt 'mapbox-navigation-android' 'android' ./scripts/sdks_file.txt \ No newline at end of file diff --git a/scripts/check_binary_size.sh b/scripts/check_binary_size.sh index 0f32d97a331..c950b3b4bbb 100755 --- a/scripts/check_binary_size.sh +++ b/scripts/check_binary_size.sh @@ -9,15 +9,15 @@ paths_file=$1 labels_file=$2 # Argument 3 is the repo name repo_name=$3 -# Argument 4 is the SDK -sdk=$4 -# Argument 5 is a file including the platforms (one per line) - Must match paths_file number of lines / size -platforms_file=$5 +# Argument 4 is the platform +platform=$4 +# Argument 5 is a file including the different SDKs / modules (one per line) - Must match paths_file number of lines / size +sdks_file=$5 source=mobile.binarysize scripts_path="scripts" -json_name="$scripts_path/${sdk}-binarysize.json" -json_gz="$scripts_path/${sdk}-binarysize.json.gz" +json_name="$scripts_path/${platform}-binarysize.json" +json_gz="$scripts_path/${platform}-binarysize.json.gz" date=`date '+%Y-%m-%d'` utc_iso_date=`date -u +'%Y-%m-%dT%H:%M:%SZ'` @@ -36,17 +36,17 @@ do i=$(($i + 1)) done <"$paths_file" -while read platform +while read sdk do - platforms+=("$platform") -done <"$platforms_file" + sdks+=("$sdk") +done <"$sdks_file" # Write binary size to json file i=0 while read path do file_size=$(wc -c <"$path" | sed -e 's/^[[:space:]]*//') - echo "{"sdk": ${sdk}, "platform": ${platforms[${i}]}, "size": ${file_size}, "created_at": "${utc_iso_date}"}" >> "$json_name" + echo "{\"platform\": \"${platform}\", \"sdk\": \"${sdks[${i}]}\", \"size\": ${file_size}, \"created_at\": \"${utc_iso_date}\"}" >> "$json_name" i=$(($i + 1)) done <"$paths_file" diff --git a/scripts/platforms_file.txt b/scripts/sdks_file.txt similarity index 100% rename from scripts/platforms_file.txt rename to scripts/sdks_file.txt