public class CodeModifier extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
DOJO_LOCALES
The Dojo supported locales used for "extraLocales".
|
static Set<String> |
dojoLocales
The hash set with Dojo locales.
|
Constructor and Description |
---|
CodeModifier()
Constructor with the settings.
|
Modifier and Type | Method and Description |
---|---|
String |
createSource_Build_JSON(RuntimeBuilderSettings settings,
File appDir,
boolean isVerbose)
Creates the "build.json" file.
|
File |
getClassPath(Class<?> clazz)
Gets the classpath from a class.
|
static String |
getDojoLanguageCode(String languageCode)
Gets the locale that matches the Dojo locale if possible.
|
File |
getFile(String name)
Gets a file from the resources.
|
Map<String,String> |
getLanguageStringsMap(RuntimeBuilderSettings settings)
Gets the English language strings required in "msg.js" for internal build or "msg-customized.js"
for customized iiziRun's.
|
ZipFile |
getZipFile(String name)
Gets a ZIP file from the resources.
|
static List<com.iizix.run.common.CodeModifier.Texts> |
loadTextFile(File dir)
Loads the localized text entries from the files.
|
protected URL |
resolve(URL url)
Resolves the resources/dojo.zip from the URL.
|
List<com.iizix.run.common.CodeModifier.Texts> |
writeTextFile(File dir,
RuntimeBuilderSettings settings)
Writes all the text's used in the app, for all text tables into an UTF-8 encoded file that is read later on
by the pre-build processor to Android, iOS or Android.
|
public static final String[] DOJO_LOCALES
public CodeModifier() throws IOException
IOException
- If the resources directory cannot be found.public static String getDojoLanguageCode(String languageCode)
languageCode
- The language code.protected URL resolve(URL url) throws IOException
url
- to the file "dojo.zip" in resources directory.IOException
- For I/O errors.public File getClassPath(Class<?> clazz) throws IOException
clazz
- The class to check.IOException
- For I/O errors.public File getFile(String name) throws IOException
name
- The name of the file.IOException
- For I/O errors.public ZipFile getZipFile(String name) throws IOException
name
- The name of the ZIP file.IOException
- For I/O errors.public Map<String,String> getLanguageStringsMap(RuntimeBuilderSettings settings) throws FileNotFoundException, IOException
settings
- The settings, null if normal customized iiziRun's.IOException
- For file errors.FileNotFoundException
public List<com.iizix.run.common.CodeModifier.Texts> writeTextFile(File dir, RuntimeBuilderSettings settings) throws IOException
dir
- The root directory where "config.xml" is located.settings
- The settings.IOException
- For file errors.public static List<com.iizix.run.common.CodeModifier.Texts> loadTextFile(File dir) throws IOException
dir
- The app's root directory where "config.xml" is located.IOException
- For file errors.public String createSource_Build_JSON(RuntimeBuilderSettings settings, File appDir, boolean isVerbose)
settings
- The settings.appDir
- The root of the Cordova app dir.iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.