Merge branch 'master' into feature/experimential_configuration_select

This commit is contained in:
Ivan Smolin 2019-11-19 18:30:37 +03:00
commit 02b107e7a8
5 changed files with 8 additions and 8 deletions

View File

@ -7,7 +7,7 @@ configurations {
}
dependencies {
apigenerator 'ru.touchin:api-generator:1.4.0-alpha1'
apigenerator 'ru.touchin:api-generator:1.4.0-beta1'
}
android.applicationVariants.all { variant ->

View File

@ -7,7 +7,7 @@ configurations {
}
dependencies {
apigeneratorKotlinServer 'ru.touchin:api-generator:1.3.4'
apigeneratorKotlinServer 'ru.touchin:api-generator:1.4.0-alpha1'
}
task generateApiModelsKotlinServer doLast {

View File

@ -1,5 +1,5 @@
<?php
$PROJECT_NAME = $argv[1];
$PRODUCT_NAME = $argv[1];
$COMMON_STRINGS_PATH = $argv[2];
function createFolder($path) {
@ -8,7 +8,7 @@
}
}
$localization = './'.$PROJECT_NAME.'/Resources/Localization/';
$localization = './'.$PRODUCT_NAME.'/Resources/Localization/';
$baseFile = file_get_contents(array_pop(glob($COMMON_STRINGS_PATH.'/default*.json')));
$baseJson = json_decode($baseFile, true);
@ -38,7 +38,7 @@
'// swiftlint:disable line_length'.PHP_EOL.
'// swiftlint:disable file_length'.PHP_EOL.
'// swiftlint:disable identifier_name'.PHP_EOL.PHP_EOL.
'extension String {'.PHP_EOL;
'public extension String {'.PHP_EOL;
foreach ($json as $key=>$value) {
$value_without_linefeed = preg_replace("/\r|\n/", " ", $value);
$ios_swift_strings .= "\t/// ".$value_without_linefeed."\n\t".'static let '.preg_replace_callback('/_(.?)/', function ($m) { return strtoupper($m[1]); }, $key).' = NSLocalizedString("'.$key.'", comment: "")'."\n".PHP_EOL;

View File

@ -6,4 +6,4 @@ link="https://dl.bintray.com/touchin/touchin-tools/ru/touchin/api-generator/${VE
. build-scripts/xcode/aux_scripts/download_file.sh ${FILE_NAME} ${link}
# execute api generator
java -jar "Downloads/${FILE_NAME}" generate-client-code --output-language SWIFT --specification-path common/api --output-path ${PROJECT_NAME}/Generated --single-file true
java -jar "Downloads/${FILE_NAME}" generate-client-code --output-language SWIFT --specification-path common/api --output-path ${PRODUCT_NAME}/Generated --single-file true

View File

@ -1,4 +1,4 @@
LOCALIZATION_PATH="${PROJECT_NAME}/Resources/Localization"
LOCALIZATION_PATH="${PRODUCT_NAME}/Resources/Localization"
#first argument set strings folder path
STRINGS_FOLDER=${1:-"common/strings"}
@ -13,4 +13,4 @@ if ! [ -e "${PROJECT_DIR}/${STRINGS_FOLDER}" ]; then
fi
#second argument set strings script path
php ${2:-build-scripts/xcode/aux_scripts/import_strings.php} ${PROJECT_NAME} ${STRINGS_FOLDER}
php ${2:-build-scripts/xcode/aux_scripts/import_strings.php} ${PRODUCT_NAME} ${STRINGS_FOLDER}