xml formatting and comments for IITC_Application
This commit is contained in:
parent
1b1c850532
commit
499ff6f09d
@ -68,26 +68,7 @@
|
|||||||
-->
|
-->
|
||||||
<import file="custom_rules.xml" optional="true" />
|
<import file="custom_rules.xml" optional="true" />
|
||||||
|
|
||||||
<!-- Import the actual build file.
|
<!-- allow the package name to be overridden when building -->
|
||||||
|
|
||||||
To customize existing targets, there are two options:
|
|
||||||
- Customize only one target:
|
|
||||||
- copy/paste the target into this file, *before* the
|
|
||||||
<import> task.
|
|
||||||
- customize it to your needs.
|
|
||||||
- Customize the whole content of build.xml
|
|
||||||
- copy/paste the content of the rules files (minus the top node)
|
|
||||||
into this file, replacing the <import> task.
|
|
||||||
- customize to your needs.
|
|
||||||
|
|
||||||
***********************
|
|
||||||
****** IMPORTANT ******
|
|
||||||
***********************
|
|
||||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
|
||||||
in order to avoid having your file be overridden by tools such as "android update project"
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- allow the package name to be overridden when building -->
|
|
||||||
<property name="override.package.name" value="com.cradle.iitc_mobile.test"/>
|
<property name="override.package.name" value="com.cradle.iitc_mobile.test"/>
|
||||||
|
|
||||||
<!-- Puts the project's resources into the output package file
|
<!-- Puts the project's resources into the output package file
|
||||||
@ -137,29 +118,29 @@
|
|||||||
|
|
||||||
<!-- Custom targets -->
|
<!-- Custom targets -->
|
||||||
<target name="-custom-git-version">
|
<target name="-custom-git-version">
|
||||||
<exec executable="sh" outputproperty="git.commits">
|
<exec executable="sh" outputproperty="git.commits">
|
||||||
<arg value="-c" />
|
<arg value="-c" />
|
||||||
<arg value="git log --pretty=format:'' | wc -l" />
|
<arg value="git log --pretty=format:'' | wc -l" />
|
||||||
</exec>
|
</exec>
|
||||||
<echo>git.commits: ${git.commits}</echo>
|
<echo>git.commits: ${git.commits}</echo>
|
||||||
<exec executable="git" outputproperty="git.version">
|
<exec executable="git" outputproperty="git.version">
|
||||||
<arg value="rev-parse" />
|
<arg value="rev-parse" />
|
||||||
<arg value="--short" />
|
<arg value="--short" />
|
||||||
<arg value="HEAD" />
|
<arg value="HEAD" />
|
||||||
</exec>
|
</exec>
|
||||||
<echo>git.version: ${git.version}</echo>
|
<echo>git.version: ${git.version}</echo>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="-custom-manifest-version">
|
<target name="-custom-manifest-version">
|
||||||
<echo>Creating backup of AndroidManifest.xml</echo>
|
<echo>Creating backup of AndroidManifest.xml</echo>
|
||||||
<copy file="AndroidManifest.xml" tofile="AndroidManifest.xml.antbak" preservelastmodified="true" />
|
<copy file="AndroidManifest.xml" tofile="AndroidManifest.xml.antbak" preservelastmodified="true" />
|
||||||
|
|
||||||
<replaceregexp
|
<replaceregexp
|
||||||
file="AndroidManifest.xml"
|
file="AndroidManifest.xml"
|
||||||
match='android:versionCode="(\d+)"'
|
match='android:versionCode="(\d+)"'
|
||||||
replace='android:versionCode="${git.commits}"' />
|
replace='android:versionCode="${git.commits}"' />
|
||||||
|
|
||||||
<replaceregexp
|
<replaceregexp
|
||||||
file="AndroidManifest.xml"
|
file="AndroidManifest.xml"
|
||||||
match='android:versionName="(\d+\.\d+\.\d+)"'
|
match='android:versionName="(\d+\.\d+\.\d+)"'
|
||||||
replace='android:versionName="\1.${git.version}"' />
|
replace='android:versionName="\1.${git.version}"' />
|
||||||
@ -188,17 +169,35 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="-test-revert">
|
<target name="-test-revert">
|
||||||
<echo>Restoring backup of strings.xml and preferences.xml</echo>
|
<echo>Restoring backup of strings.xml and preferences.xml</echo>
|
||||||
<move file="strings.xml.antbak"
|
<move file="strings.xml.antbak"
|
||||||
tofile="res/values/strings.xml"
|
tofile="res/values/strings.xml"
|
||||||
preservelastmodified="true"
|
preservelastmodified="true"
|
||||||
overwrite="true" />
|
overwrite="true" />
|
||||||
<move file="preferences.xml.antbak"
|
<move file="preferences.xml.antbak"
|
||||||
tofile="res/xml/preferences.xml"
|
tofile="res/xml/preferences.xml"
|
||||||
preservelastmodified="true"
|
preservelastmodified="true"
|
||||||
overwrite="true" />
|
overwrite="true" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<!-- Import the actual build file.
|
||||||
|
|
||||||
|
To customize existing targets, there are two options:
|
||||||
|
- Customize only one target:
|
||||||
|
- copy/paste the target into this file, *before* the
|
||||||
|
<import> task.
|
||||||
|
- customize it to your needs.
|
||||||
|
- Customize the whole content of build.xml
|
||||||
|
- copy/paste the content of the rules files (minus the top node)
|
||||||
|
into this file, replacing the <import> task.
|
||||||
|
- customize to your needs.
|
||||||
|
|
||||||
|
***********************
|
||||||
|
****** IMPORTANT ******
|
||||||
|
***********************
|
||||||
|
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||||
|
in order to avoid having your file be overridden by tools such as "android update project"
|
||||||
|
-->
|
||||||
<!-- version-tag: 1 -->
|
<!-- version-tag: 1 -->
|
||||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||||
|
|
||||||
|
@ -5,6 +5,12 @@ import android.preference.PreferenceManager;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* To write the WebView cache to external storage we need to override the
|
||||||
|
* getCacheDir method of the main application. Some internal Android code seems
|
||||||
|
* to call getApplicationContext().getCacheDir(); instead of
|
||||||
|
* getContext().getCacheDir(); to decide where to store and read cached files.
|
||||||
|
*/
|
||||||
public class IITC_Application extends Application {
|
public class IITC_Application extends Application {
|
||||||
@Override
|
@Override
|
||||||
public File getCacheDir() {
|
public File getCacheDir() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user