Add support for languages field in iOS/Android/AIR templates

This commit is contained in:
Joshua Granick
2018-07-07 06:48:51 -07:00
parent cd7d2b3fcf
commit 673d1cf014
3 changed files with 76 additions and 70 deletions

View File

@@ -36,6 +36,7 @@
::if (icons != null)::<icon>::foreach icons::
<image::size::x::size::>::path::</image::size::x::size::>::end::
</icon>::end::
::if (languages != null)::<supportedLanguages>::foreach languages::::__current__:: ::end::</supportedLanguages>::end::
<customUpdateUI>false</customUpdateUI>
<allowBrowserInvocation>false</allowBrowserInvocation>
<!-- <fileTypes>

View File

@@ -15,20 +15,21 @@ android {
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
::if (languages != null)::resConfigs ::foreach languages::"::__current__::", ::end::""::end::
}
::if KEY_STORE::
signingConfigs {
if (project.KEY_STORE_PASSWORD == 'null') {
def keyStoreFile = project.KEY_STORE.split('/')
keyStoreFile = keyStoreFile[keyStoreFile.length - 1]
project.KEY_STORE_PASSWORD = getPassword('\nPlease enter key password for ' + keyStoreFile + ':');
}
if (project.KEY_STORE_ALIAS_PASSWORD == 'null') {
project.KEY_STORE_ALIAS_PASSWORD = getPassword("\nPlease enter key alias password for alias " + project.KEY_STORE_ALIAS + ":")
}
if (project.KEY_STORE_PASSWORD == 'null') {
def keyStoreFile = project.KEY_STORE.split('/')
keyStoreFile = keyStoreFile[keyStoreFile.length - 1]
project.KEY_STORE_PASSWORD = getPassword('\nPlease enter key password for ' + keyStoreFile + ':');
}
if (project.KEY_STORE_ALIAS_PASSWORD == 'null') {
project.KEY_STORE_ALIAS_PASSWORD = getPassword("\nPlease enter key alias password for alias " + project.KEY_STORE_ALIAS + ":")
}
release {
storeFile file(project.KEY_STORE)
storePassword project.KEY_STORE_PASSWORD
@@ -65,14 +66,14 @@ android {
}
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
output.outputFile = new File(outputFile.parent, "::APP_FILE::-" + variant.buildType.name + ".apk")
}
}
}
if (outputFile != null && outputFile.name.endsWith('.apk')) {
output.outputFile = new File(outputFile.parent, "::APP_FILE::-" + variant.buildType.name + ".apk")
}
}
}
}
dependencies {
@@ -82,57 +83,57 @@ dependencies {
}
def getPassword(message) {
def password = '';
if (System.console() == null) {
new SwingBuilder().edt {
dialog(
title: 'Enter password',
alwaysOnTop: true,
size: [350, 150],
resizable: false,
locationRelativeTo: null,
pack: true,
modal: true,
show: true
) {
lookAndFeel('system')
panel(border: new EmptyBorder(10, 10, 10, 10)) {
gridBagLayout()
def gbc = new GridBagConstraints();
gbc.gridx = 0
gbc.gridy = 0
gbc.fill = GridBagConstraints.HORIZONTAL
gbc.insets = [0, 0, 10, 0]
label(
text: '<html>' +
'<body style="width: 350px">' +
message +
'</body>' +
'</html>',
constraints: gbc)
gbc.gridy = 1
input = passwordField(constraints: gbc)
gbc.gridy = 2
gbc.fill = GridBagConstraints.NONE
gbc.insets = [0, 0, 0, 0]
gbc.ipadx = 50
button = button(
defaultButton: true,
text: 'OK',
actionPerformed: {
password = input.password
dispose()
},
constraints: gbc)
}
}
}
} else {
password = System.console().readPassword(message)
}
return new String(password)
def password = '';
if (System.console() == null) {
new SwingBuilder().edt {
dialog(
title: 'Enter password',
alwaysOnTop: true,
size: [350, 150],
resizable: false,
locationRelativeTo: null,
pack: true,
modal: true,
show: true
) {
lookAndFeel('system')
panel(border: new EmptyBorder(10, 10, 10, 10)) {
gridBagLayout()
def gbc = new GridBagConstraints();
gbc.gridx = 0
gbc.gridy = 0
gbc.fill = GridBagConstraints.HORIZONTAL
gbc.insets = [0, 0, 10, 0]
label(
text: '<html>' +
'<body style="width: 350px">' +
message +
'</body>' +
'</html>',
constraints: gbc)
gbc.gridy = 1
input = passwordField(constraints: gbc)
gbc.gridy = 2
gbc.fill = GridBagConstraints.NONE
gbc.insets = [0, 0, 0, 0]
gbc.ipadx = 50
button = button(
defaultButton: true,
text: 'OK',
actionPerformed: {
password = input.password
dispose()
},
constraints: gbc)
}
}
}
} else {
password = System.console().readPassword(message)
}
return new String(password)
}

View File

@@ -4,6 +4,10 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
::if (languages != null)::<key>CFBundleLocalizations</key>
<array>::foreach languages::
<string>::__current__::</string>::end::
</array>::end::
<key>CFBundleDisplayName</key>
<string>::APP_TITLE::</string>
<key>CFBundleExecutable</key>