Merge branch 'gradle_only_and_k9mail_library'

Conflicts:
	k9mail-library/src/main/java/com/fsck/k9/mail/transport/imap/ImapSettings.java
	src/com/fsck/k9/mail/store/imap/ImapSettings.java
	src/com/fsck/k9/mail/transport/imap/ImapSettings.java
This commit is contained in:
cketti 2014-12-20 04:46:14 +01:00
commit 7752f42db6
1032 changed files with 200 additions and 3199 deletions

View File

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>k9mail</name>
<comment></comment>
<projects>
<project>k9mail-Android-PullToRefresh</project>
<project>k9mail-ckChangeLog</project>
<project>k9mail-HoloColorPicker</project>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -3,6 +3,6 @@ host = https://www.transifex.com
lang_map = af_ZA: af-rZA, am_ET: am-rET, ar_AE: ar-rAE, ar_BH: ar-rBH, ar_DZ: ar-rDZ, ar_EG: ar-rEG, ar_IQ: ar-rIQ, ar_JO: ar-rJO, ar_KW: ar-rKW, ar_LB: ar-rLB, ar_LY: ar-rLY, ar_MA: ar-rMA, ar_OM: ar-rOM, ar_QA: ar-rQA, ar_SA: ar-rSA, ar_SY: ar-rSY, ar_TN: ar-rTN, ar_YE: ar-rYE, arn_CL: arn-rCL, as_IN: as-rIN, az_AZ: az-rAZ, ba_RU: ba-rRU, be_BY: be-rBY, bg_BG: bg-rBG, bn_BD: bn-rBD, bn_IN: bn-rIN, bo_CN: bo-rCN, br_FR: br-rFR, bs_BA: bs-rBA, ca_ES: ca-rES, co_FR: co-rFR, cs_CZ: cs-rCZ, cy_GB: cy-rGB, da_DK: da-rDK, de_AT: de-rAT, de_CH: de-rCH, de_DE: de-rDE, de_LI: de-rLI, de_LU: de-rLU, dsb_DE: dsb-rDE, dv_MV: dv-rMV, el_GR: el-rGR, en_AU: en-rAU, en_BZ: en-rBZ, en_CA: en-rCA, en_GB: en-rGB, en_IE: en-rIE, en_IN: en-rIN, en_JM: en-rJM, en_MY: en-rMY, en_NZ: en-rNZ, en_PH: en-rPH, en_SG: en-rSG, en_TT: en-rTT, en_US: en-rUS, en_ZA: en-rZA, en_ZW: en-rZW, es_AR: es-rAR, es_BO: es-rBO, es_CL: es-rCL, es_CO: es-rCO, es_CR: es-rCR, es_DO: es-rDO, es_EC: es-rEC, es_ES: es-rES, es_GT: es-rGT, es_HN: es-rHN, es_MX: es-rMX, es_NI: es-rNI, es_PA: es-rPA, es_PE: es-rPE, es_PR: es-rPR, es_PY: es-rPY, es_SV: es-rSV, es_US: es-rUS, es_UY: es-rUY, es_VE: es-rVE, et_EE: et-rEE, eu_ES: eu-rES, fa_IR: fa-rIR, fi_FI: fi-rFI, fil_PH: fil-rPH, fo_FO: fo-rFO, fr_BE: fr-rBE, fr_CA: fr-rCA, fr_CH: fr-rCH, fr_FR: fr-rFR, fr_LU: fr-rLU, fr_MC: fr-rMC, fy_NL: fy-rNL, ga_IE: ga-rIE, gd_GB: gd-rGB, gl_ES: gl-rES, gsw_FR: gsw-rFR, gu_IN: gu-rIN, ha_NG: ha-rNG, hi_IN: hi-rIN, hr_BA: hr-rBA, hr_HR: hr-rHR, hsb_DE: hsb-rDE, hu_HU: hu-rHU, hy_AM: hy-rAM, id_ID: id-rID, ig_NG: ig-rNG, ii_CN: ii-rCN, is_IS: is-rIS, it_CH: it-rCH, it_IT: it-rIT, iu_CA: iu-rCA, ja_JP: ja-rJP, ka_GE: ka-rGE, kk_KZ: kk-rKZ, kl_GL: kl-rGL, km_KH: km-rKH, kn_IN: kn-rIN, ko_KR: ko-rKR, kok_IN: kok-rIN, ky_KG: ky-rKG, lb_LU: lb-rLU, lo_LA: lo-rLA, lt_LT: lt-rLT, lv_LV: lv-rLV, mi_NZ: mi-rNZ, mk_MK: mk-rMK, ml_IN: ml-rIN, mn_CN: mn-rCN, mn_MN: mn-rMN, moh_CA: moh-rCA, mr_IN: mr-rIN, ms_BN: ms-rBN, ms_MY: ms-rMY, mt_MT: mt-rMT, nb_NO: nb-rNO, ne_NP: ne-rNP, nl_BE: nl-rBE, nl_NL: nl-rNL, nn_NO: nn-rNO, nso_ZA: nso-rZA, oc_FR: oc-rFR, or_IN: or-rIN, pa_IN: pa-rIN, pl_PL: pl-rPL, prs_AF: prs-rAF, ps_AF: ps-rAF, pt_BR: pt-rBR, pt_PT: pt-rPT, qut_GT: qut-rGT, quz_BO: quz-rBO, quz_EC: quz-rEC, quz_PE: quz-rPE, rm_CH: rm-rCH, ro_RO: ro-rRO, ru_RU: ru-rRU, rw_RW: rw-rRW, sa_IN: sa-rIN, sah_RU: sah-rRU, se_FI: se-rFI, se_NO: se-rNO, se_SE: se-rSE, si_LK: si-rLK, sk_SK: sk-rSK, sl_SI: sl-rSI, sma_NO: sma-rNO, sma_SE: sma-rSE, smj_NO: smj-rNO, smj_SE: smj-rSE, smn_FI: smn-rFI, sms_FI: sms-rFI, sq_AL: sq-rAL, sr_BA: sr-rBA, sr_CS: sr-rCS, sr_ME: sr-rME, sr_RS: sr-rRS, sv_FI: sv-rFI, sv_SE: sv-rSE, sw_KE: sw-rKE, syr_SY: syr-rSY, ta_IN: ta-rIN, te_IN: te-rIN, tg_TJ: tg-rTJ, th_TH: th-rTH, tk_TM: tk-rTM, tn_ZA: tn-rZA, tr_TR: tr-rTR, tt_RU: tt-rRU, tzm_DZ: tzm-rDZ, ug_CN: ug-rCN, uk_UA: uk-rUA, ur_PK: ur-rPK, uz_UZ: uz-rUZ, vi_VN: vi-rVN, wo_SN: wo-rSN, xh_ZA: xh-rZA, yo_NG: yo-rNG, zh_CN: zh-rCN, zh_HK: zh-rHK, zh_MO: zh-rMO, zh_SG: zh-rSG, zh_TW: zh-rTW, zu_ZA: zu-rZA, no_NO: no-rNO, he_IL: iw-rIL, he: iw
[k9mail.strings]
file_filter = res/values-<lang>/strings.xml
source_file = res/values/strings.xml
file_filter = k9mail/src/main/res/values-<lang>/strings.xml
source_file = k9mail/src/main/res/values/strings.xml
source_lang = en

View File

@ -1,47 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_STATIC_JAVA_LIBRARIES += libcore
LOCAL_STATIC_JAVA_LIBRARIES += libdom
LOCAL_STATIC_JAVA_LIBRARIES += libio
LOCAL_STATIC_JAVA_LIBRARIES += libjutf
LOCAL_STATIC_JAVA_LIBRARIES += libjzlib
LOCAL_STATIC_JAVA_LIBRARIES += libhtmlcleaner
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += $(call all-java-files-under, plugins/Android-PullToRefresh/library/src)
LOCAL_SRC_FILES += $(call all-java-files-under, plugins/ckChangeLog/library/src)
LOCAL_SRC_FILES += $(call all-java-files-under, plugins/HoloColorPicker/src)
res_dir := res plugins/Android-PullToRefresh/library/res plugins/ckChangeLog/library/res plugins/HoloColorPicker/res
LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir))
LOCAL_SDK_VERSION := current
LOCAL_PACKAGE_NAME := Email
LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages de.cketti.library.changelog
LOCAL_AAPT_FLAGS += --extra-packages android.support.v4.app
LOCAL_AAPT_FLAGS += --extra-packages com.handmark.pulltorefresh.library
LOCAL_AAPT_FLAGS += --extra-packages com.larswerkman.colorpicker
LOCAL_PROGUARD_FLAG_FILES := proguard.cfg
include $(BUILD_PACKAGE)
##################################################
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += libcore:libs/apache-mime4j-core-0.7.2.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += libdom:libs/apache-mime4j-dom-0.7.2.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += libio:libs/commons-io-2.0.1.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += libjutf:libs/jutf7-1.0.1-SNAPSHOT.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += libjzlib:libs/jzlib-1.0.7.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += libhtmlcleaner:libs/htmlcleaner-2.2.jar
include $(BUILD_MULTI_PREBUILT)

View File

View File

@ -1,6 +1,6 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
@ -9,30 +9,6 @@ buildscript {
}
}
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
repositories {
jcenter()
}
dependencies {
compile project(':plugins:Android-PullToRefresh:library')
compile project(':plugins:ckChangeLog:library')
compile project(':plugins:HoloColorPicker')
compile project(':plugins:openpgp-api-library')
compile 'org.apache.james:apache-mime4j-core:0.7.2'
compile 'org.apache.james:apache-mime4j-dom:0.7.2'
compile 'commons-io:commons-io:2.0.1'
compile 'com.jcraft:jzlib:1.0.7'
compile 'com.beetstra.jutf7:jutf7:1.0.0'
compile 'com.android.support:support-v4:21.0.2'
compile 'com.android.support:support-v13:21.0.2'
compile 'net.sourceforge.htmlcleaner:htmlcleaner:2.2'
}
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
project.ext.testCoverage = project.hasProperty('testCoverage')
@ -44,102 +20,3 @@ subprojects {
}
}
}
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
minSdkVersion 15
targetSdkVersion 17
}
dexOptions {
preDexLibraries = rootProject.ext.preDexLibs
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
androidTest {
manifest.srcFile 'tests/AndroidManifest.xml'
java.srcDirs = ['tests/src']
assets.srcDirs = ['tests/assets']
}
}
signingConfigs {
release
}
buildTypes {
release {
if (project.hasProperty('storeFile')) {
signingConfig signingConfigs.release
}
}
debug {
testCoverageEnabled rootProject.testCoverage
}
}
// Do not abort build if lint finds errors
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
}
check.dependsOn 'checkstyle'
task checkstyle(type: Checkstyle) {
ignoreFailures = true
configFile file("config/checkstyle/checkstyle.xml")
source = project.android.sourceSets.main.java.getSrcDirs() +
project.android.sourceSets.androidTest.java.getSrcDirs()
include '**/*.java'
classpath = files()
}
check.dependsOn 'findbugs'
task findbugs(type: FindBugs, dependsOn: [':compileDebugJava', ':compileDebugTestJava']) {
ignoreFailures = true
classes = fileTree('build/intermediates/classes/debug/') +
fileTree('build/intermediates/classes/test/debug/')
source = project.android.sourceSets.main.java.getSrcDirs() +
project.android.sourceSets.androidTest.java.getSrcDirs()
classpath = files()
effort = 'max'
includeFilter = file("$rootProject.projectDir/config/findbugs/include_filter.xml")
excludeFilter = file("$rootProject.projectDir/config/findbugs/exclude_filter.xml")
}
if (project.hasProperty('keyAlias')) {
android.signingConfigs.release.keyAlias = keyAlias
}
if (project.hasProperty('keyPassword')) {
android.signingConfigs.release.keyPassword = keyPassword
}
if (project.hasProperty('storeFile')) {
android.signingConfigs.release.storeFile = file(storeFile)
}
if (project.hasProperty('storePassword')) {
android.signingConfigs.release.storePassword = storePassword
}

472
build.xml
View File

@ -1,472 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="K9" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- 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: custom -->
<import file="${sdk.dir}/tools/ant/build.xml" />
<!-- K9 CUSTOM STUFF -->
<!-- out folders for a parent project if this project is an instrumentation project -->
<property name="rclib" value="${out.dir}/K9RemoteControl.jar" />
<property name="rcdir" value="com/fsck/k9/remotecontrol/**" />
<property name="changelog-path-src" value="res/xml/changelog_master.xml" />
<!-- Name given to the remote git repository -->
<property name="origin" value="origin" />
<!-- Name used for the temporary gh-pages branch in the local git repo -->
<property name="gh-pages-tmp" value="gh-pages-tmp" />
<condition property="android.executable" value="android.bat">
<os family="windows" />
</condition>
<property name="android.executable" value="android" />
<target name="-get-version" depends="-get-version-name">
<echo>Building version number ${current-version-name}</echo>
</target>
<target name="-get-version-name">
<xpath input="AndroidManifest.xml" expression="/manifest/@android:versionName" output="current-version-name" />
</target>
<target name="-get-version-code">
<xpath input="AndroidManifest.xml" expression="/manifest/@android:versionCode" output="current-version-code" />
</target>
<target name="-get-version-from-git">
<exec executable="git" failonerror="true" outputproperty="current-version-name" errorproperty="current-version-error">
<arg line="describe --tags" />
</exec>
<echo>Building version number ${current-version-name}</echo>
</target>
<target name="-auto-incr-version">
<regex property="major" input="${current-version-name}" regexp="(\d+)\.\d+" select="\1" />
<regex property="minor" input="${current-version-name}" regexp="\d+\.(\d+)" select="\1" />
<math result="minor" operand1="${minor}" operation="+" operand2="1" datatype="int"/>
<if.contrib>
<length string="${minor}" when="eq" length="1" />
<then>
<var name="minor" value="00${minor}" />
</then>
<elseif>
<length string="${minor}" when="eq" length="2" />
<then>
<var name="minor" value="0${minor}" />
</then>
</elseif>
</if.contrib>
<regex property="version-name" input="${major}." regexp="(\d+.)" replace="\1${minor}" />
</target>
<target name="-pre-bump-check" depends="-get-version-name,-auto-incr-version">
<xpath
input="${changelog-path-src}"
expression="/changelog/release[@version='${version-name}']/@version"
output="changelog-test" />
<if.contrib>
<equals arg1="${changelog-test}" arg2="${version-name}" />
<else>
<fail>No changelog for ${version-name}.</fail>
</else>
</if.contrib>
<exec executable="git" failonerror="true" outputproperty="git-status" errorproperty="git-status-error">
<arg line="status -s ${changelog-path-src}" />
</exec>
<if.contrib>
<equals arg1="${git-status}" arg2="" />
<else>
<fail>Uncomitted changelog edits.</fail>
</else>
</if.contrib>
<!-- Check for a clean index, because it will be reset in -update-gh-pages-branch -->
<exec executable="git" failonerror="true">
<arg line="diff-index --cached --quiet HEAD" />
</exec>
<!-- Check that the temporary gh-pages branch doesn't exist in the local git repo -->
<exec executable="git" failonerror="true" outputproperty="gh-pages-tmp-status" errorproperty="gh-pages-tmp-status-error">
<arg line="branch --list ${gh-pages-tmp}" />
</exec>
<if.contrib>
<equals arg1="${gh-pages-tmp-status}" arg2="" />
<else>
<fail>Temporary branch ${gh-pages-tmp} exists (but should not).</fail>
</else>
</if.contrib>
<!-- Check that there is no existing git tag for the new version -->
<exec executable="git" failonerror="true" outputproperty="git-tag-status" errorproperty="git-tag-status-error">
<arg line="tag --list ${version-name}" />
</exec>
<if.contrib>
<equals arg1="${git-tag-status}" arg2="" />
<else>
<fail>A git tag for version ${version-name} already exists (but should not).</fail>
</else>
</if.contrib>
<!-- Assure that we have the latest gh-pages branch -->
<exec executable="git" failonerror="true">
<arg line="fetch ${origin} +refs/heads/gh-pages:refs/remotes/${origin}/gh-pages" />
</exec>
</target>
<target name="-set-version" depends="-get-version-name,-get-version-code">
<!-- pass -Dversion-name=4.200 to define the version instead of auto-incrementing it -->
<if.contrib>
<isset property="version-name" />
<else>
<runtarget target="-auto-incr-version" />
</else>
</if.contrib>
<echo>Setting version to ${version-name}</echo>
<replace file="AndroidManifest.xml"
token="android:versionName=&quot;${current-version-name}&quot;"
value="android:versionName=&quot;${version-name}&quot;" summary="true"
/>
<math result="new-version-code" operand1="${current-version-code}" operation="+" operand2="1" datatype="int"/>
<replace file="AndroidManifest.xml"
token="android:versionCode=&quot;${current-version-code}&quot;"
value="android:versionCode=&quot;${new-version-code}&quot;" summary="true"
/>
</target>
<!-- rules -->
<target name="bump-version" depends="-pre-bump-check,-set-version,-commit-version,-update-gh-pages-branch,-push-version">
<echo>Bumped K-9 to ${version-name}</echo>
</target>
<target name="-commit-version">
<exec executable="git" failonerror="true">
<arg line="commit -m'Bumped manifest to ${version-name}' AndroidManifest.xml" />
</exec>
<exec executable="git" failonerror="true">
<arg line="tag ${version-name}" />
</exec>
</target>
<!-- Copy the changelog to the gh-pages branch. -->
<target name="-update-gh-pages-branch">
<!-- Create a temporary branch for use in updating the remote gh-pages branch. -->
<exec executable="git" failonerror="true">
<arg line="branch ${gh-pages-tmp} ${origin}/gh-pages" />
</exec>
<!-- Save HEAD before switching branches -->
<exec executable="git" failonerror="true" outputproperty="git-branch-ref" errorproperty="git-branch-ref-error">
<arg line="symbolic-ref HEAD" />
</exec>
<!-- Switch to the temporary branch with no checkout. The working tree remains untouched. -->
<exec executable="git" failonerror="true">
<arg line="symbolic-ref HEAD refs/heads/${gh-pages-tmp}" />
</exec>
<!-- Clean up the index on the temporary branch -->
<exec executable="git" failonerror="true">
<arg line="reset -q" />
</exec>
<!-- Retrieve tree info for the changelog file to be copied from HEAD -->
<exec executable="git" failonerror="true" outputproperty="git-ls-tree" errorproperty="git-ls-tree-error">
<arg line="ls-tree ${git-branch-ref} ${changelog-path-src}" />
</exec>
<!-- Update the path and name of the changelog for where it will be stored in the temp. branch -->
<regex property="changelog-path-dst" input="${git-branch-ref}" regexp=".*/([^/]+$)" select="changelog_\1_branch.xml" />
<regex property="git-index-info" input="${git-ls-tree}" regexp="(.*\t).*" select="\1${changelog-path-dst}" />
<!-- Add the changelog to the index -->
<exec executable="git" failonerror="true" inputstring="${git-index-info}">
<arg line="update-index --index-info" />
</exec>
<!-- Commit the changelog -->
<exec executable="git" failonerror="true">
<arg line="commit -m'Update changelog for version ${version-name}'" />
</exec>
<!-- Switch back to HEAD, again without touching the (original) working tree -->
<exec executable="git" failonerror="true">
<arg line="symbolic-ref HEAD ${git-branch-ref}" />
</exec>
<!-- Clean up the index for HEAD -->
<exec executable="git" failonerror="true">
<arg line="reset -q" />
</exec>
</target>
<target name="-push-version">
<exec executable="git" failonerror="true">
<arg line="push ${origin} HEAD ${gh-pages-tmp}:gh-pages tag ${version-name}" />
</exec>
<!-- Delete the temporary branch -->
<exec executable="git" failonerror="true">
<arg line="branch -D ${gh-pages-tmp}" />
</exec>
</target>
<!-- Create the output directories if they don't exist yet. -->
<target name="rclib" depends="-compile">
<echo>Creating library ${rclib} for remote control applications</echo>
<jar destfile="${rclib}" basedir="${out.classes.dir}" includes="${rcdir}" />
</target>
<target name="upload" depends="clean,-get-version,release">
<echo>Uploading to Google Code using Google::Code::Upload</echo>
<move file="${out.final.file}" tofile="bin/k9-${current-version-name}-release.apk" />
<property name="gcode-project" value="k9mail" />
<exec executable="googlecode_upload.pl" failonerror="true">
<arg value="--summary" />
<arg value="${ant.project.name} ${current-version-name}" />
<arg value="--project" />
<arg value="${gcode-project}" />
<arg value="--user" />
<arg value="${gcode-user}" />
<arg value="--pass" />
<arg value="${gcode-pass}" />
<arg value="--labels" />
<arg value="Type-Installer" />
<arg value="bin/k9-${current-version-name}-release.apk" />
</exec>
</target>
<target name="astyle">
<exec executable="astyle" failonerror="true">
<arg line="--style=java --indent=spaces=4 --indent-switches --max-instatement-indent=40 --add-brackets --convert-tabs --unpad-paren --pad-header --pad-oper --suffix=none --recursive 'src/com/fsck/k9/*.java' 'tests/src/com/fsck/k9/*.java'" />
</exec>
</target>
<target name="help" depends="android_rules.help">
<!-- displays starts at col 13
|13 80| -->
<echo>Additional targets:</echo>
<!--echo> bump-version: ant -Dversion-name=3.123</echo>
<echo> Bumps the project version to 3.123,tags and commits it.</echo>
<echo> If version-name is not given, it will auto-increment.</echo>
<echo> upload: Uploads a new release to google code.</echo-->
<echo> rclib: Creates library for remote control applications.</echo>
<echo> astyle: Make K-9's source look like it's supposed to.</echo>
<echo> eclipse: Apply template Eclipse settings.</echo>
<echo> javadoc: Javadoc output to javadoc/. ANDROID_HOME environment</echo>
<echo> variable must be set (i.e. /opt/android-sdk-linux/).</echo>
<echo> lint-xml: Lint output lint-results.xml.</echo>
<echo> lint-html: Lint output to lint-results.html.</echo>
<echo> monkey: Runs monkey on the running emulator. Change the</echo>
<echo> defaults -Dmonkey.seed=NUM and -Dmonkey.count=NUM</echo>
<echo> from 0 and 200, respectively.</echo>
</target>
<target name="eclipse" description="Apply template Eclipse settings">
<copy todir=".settings">
<fileset dir="tools/eclipse-settings" />
</copy>
</target>
<target name="monkey">
<xpath input="AndroidManifest.xml" expression="/manifest/@package" output="manifest.package" />
<property name="monkey.count" value="200" />
<property name="monkey.seed" value="0" /><!-- largest == 9223372036854775807 == 2**63 - 1 -->
<exec executable="${adb}" output="monkey.txt" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="-e" />
<arg value="shell" />
<arg value="monkey" />
<arg value="-p" />
<arg value="${manifest.package}" />
<arg value="-v" />
<arg value="-v" />
<arg value="-s" />
<arg value="${monkey.seed}" />
<arg value="${monkey.count}" />
</exec>
</target>
<target name="reg" depends="-get-version-code">
<regex property="branch" input="${env.GIT_BRANCH}" regexp="(?:.*/)?(.+)" select="\1" global="true"/>
<regex property="commit" input="${env.GIT_COMMIT}" regexp="([\da-fA-F]{10})" select="\1" global="true"/>
<math result="version-code" operand1="${current-version-code}" operation="+" operand2="1" datatype="int"/>
<echo message="branch = ${branch} ${commit} ${current-version-code} ${version-code}" />
</target>
<!-- this is for CloudBees. see tests/build.xml -->
<target name="-artifactd" depends="-set-debug-files, -artifact" />
<target name="-artifacti" depends="-set-instrumented-mode, -artifact" />
<target name="-artifact">
<regex property="branch" input="${env.GIT_BRANCH}" regexp="(?:.*/)?(.+)" select="\1" global="true" />
<regex property="commit" input="${env.GIT_COMMIT}" regexp="([\da-fA-F]{10})" select="\1" />
<copy file="${out.final.file}"
tofile="${out.dir}/${ant.project.name}-${branch}-${env.BUILD_ID}-${commit}-${env.BUILD_NUMBER}.apk"
verbose="on"
/>
</target>
<target name="-pre-clean" description="Removes testing output and javadoc">
<delete file="monkey.txt" verbose="${verbose}" />
<delete file="lint-results.xml" verbose="${verbose}" />
<delete file="lint-results.html" verbose="${verbose}" />
<delete dir="lint-results_files" verbose="${verbose}" />
<delete dir="${javadoc-dir}" verbose="${verbose}" />
</target>
<target name="-update-ptr">
<if.contrib>
<resourceexists>
<file file="plugins/Android-PullToRefresh/library/build.xml" />
</resourceexists>
<else>
<echo message="android update lib-project -p plugins/Android-PullToRefresh/library/" />
<exec executable="${sdk.dir}/tools/${android.executable}" failonerror="true">
<arg line="update lib-project -p plugins/Android-PullToRefresh/library/" />
</exec>
</else>
</if.contrib>
</target>
<target name="-update-cl">
<if.contrib>
<resourceexists>
<file file="plugins/ckChangeLog/library/build.xml" />
</resourceexists>
<else>
<echo message="android update lib-project -p plugins/ckChangeLog/library/" />
<exec executable="${sdk.dir}/tools/${android.executable}" failonerror="true">
<arg line="update lib-project -p plugins/ckChangeLog/library/" />
</exec>
</else>
</if.contrib>
</target>
<target name="-update-hcp">
<if.contrib>
<resourceexists>
<file file="plugins/HoloColorPicker/build.xml" />
</resourceexists>
<else>
<echo message="android update lib-project -p plugins/HoloColorPicker/" />
<exec executable="${sdk.dir}/tools/${android.executable}" failonerror="true">
<arg line="update lib-project -p plugins/HoloColorPicker/" />
</exec>
</else>
</if.contrib>
</target>
<target name="-update-opa">
<if.contrib>
<resourceexists>
<file file="plugins/openpgp-api-library/build.xml" />
</resourceexists>
<else>
<echo message="android update lib-project -p plugins/openpgp-api-library/" />
<exec executable="${sdk.dir}/tools/${android.executable}" failonerror="true">
<arg line="update lib-project -p plugins/openpgp-api-library/" />
</exec>
</else>
</if.contrib>
</target>
<target name="init" depends="-update-ptr, -update-cl, -update-hcp, -update-opa"
description="Initialize environment for building" />
<!-- overrides default "debug" target" -->
<!-- Builds debug output package -->
<target name="debug" depends="init, -set-debug-files, -do-debug, -post-build"
description="Builds the application and signs it with a debug key.">
</target>
<!-- common to both build.xml and tests/build.xml -->
<import file="build_common.xml" />
<!-- END K-9 CUSTOM STUFF -->
</project>

View File

@ -1,96 +0,0 @@
<project name="common">
<!-- This file contains scriptdefs, properties, targets, etc that are common
to both build.xml and tests/build.xml. It also loads ant-contrib, where
each desired task needs to be defined below as both ant-contrib and
Android's anttasks.jar define different 'if' tasks. -->
<!-- ANT-CONTRIB -->
<!-- jar file from where the tasks are loaded -->
<if>
<condition>
<isset property="tested.project.dir" />
</condition>
<then>
<path id="antcontrib">
<pathelement path="${tested.project.dir}/tools/ant-contrib.jar" />
</path>
</then>
<else>
<path id="antcontrib">
<pathelement path="tools/ant-contrib.jar" />
</path>
</else>
</if>
<!-- ant-contrib tasks -->
<!-- this is normally named propertyregex -->
<taskdef name="regex"
classname="net.sf.antcontrib.property.RegexTask"
classpathref="antcontrib" />
<taskdef name="math"
classname="net.sf.antcontrib.math.MathTask"
classpathref="antcontrib" />
<taskdef name="runtarget"
classname="net.sf.antcontrib.logic.RunTargetTask"
classpathref="antcontrib" />
<taskdef name="var"
classname="net.sf.antcontrib.property.Variable"
classpathref="antcontrib" />
<!-- renamed to not conflict with android -->
<taskdef name="if.contrib"
classname="net.sf.antcontrib.logic.IfTask"
classpathref="antcontrib" />
<!-- SCRIPTDEFS -->
<!-- PROPERTIES -->
<!-- allow environment variables to be accessable by prepending "env." -->
<property environment="env" />
<!-- javadoc folder relative to ${basedir} -->
<property name="javadoc-dir" location="javadoc" />
<!-- path to lint -->
<property name="lint" location="${android.tools.dir}/lint${bat}" />
<!-- TARGETS -->
<!-- create javadoc in ${javadoc-dir} -->
<target name="javadoc" description="build javadoc">
<mkdir dir="${javadoc-dir}"/>
<javadoc
destdir="${javadoc-dir}"
doctitle="K-9 Mail"
verbose="on"
use="true"
classpath="${env.ANDROID_HOME}/platforms/${target}/android.jar"
sourcepath="gen;src"
linkoffline="http://d.android.com/reference ${env.ANDROID_HOME}/docs/reference/"
/>
</target>
<!-- create lint-results.xml -->
<target name="lint-xml">
<exec executable="${lint}" failonerror="true">
<arg value="--xml" />
<arg value="lint-results.xml" />
<arg path="${basedir}" />
</exec>
</target>
<!-- create lint-results.html and lint-results_files/ -->
<target name="lint-html">
<exec executable="${lint}" failonerror="true">
<arg value="--html" />
<arg value="lint-results.html" />
<arg path="${basedir}" />
</exec>
</target>
</project>

Binary file not shown.

View File

@ -4,14 +4,14 @@
<!-- Transifex and Lint disagree on what quantities are necessary -->
<issue id="UnusedQuantity" severity="warning">
<ignore path="res/values-*/strings.xml" />
<ignore path="src/main/res/values-*/strings.xml" />
</issue>
<issue id="MissingQuantity" severity="warning">
<ignore path="res/values-*/strings.xml" />
<ignore path="src/main/res/values-*/strings.xml" />
</issue>
<!-- Remove this when we have separate Transifex resources for plugins -->
<issue id="ExtraTranslation" severity="error">
<ignore path="res/values-zh-rTW/plugin_strings.xml" />
<ignore path="src/main/res/values-zh-rTW/plugin_strings.xml" />
</issue>
</lint>

View File

View File

@ -1,23 +0,0 @@
Some simple functional tests
--
Compose a message
Attach an image to the message
Save the message as a draft
Reopen the draft
* Is the attachment still there?
Send the message.
* Does the received message have the correct attachment?
Check delete functionality on POP and IMAP account.
Check delete functionality on IMAP with no network connection.
Check save draft functionality on POP and IMAP account.
Check save draft functionality on IMAP with no network connection.
Check sent message functionality on POP and IMAP account.
Check sent functionality on IMAP with no network connection.
* When the network is brought back does the sent message get uploaded?

View File

@ -1,27 +0,0 @@
Currently
--
Need to add NOOP checking to Pop3Store and ImapStore on cached connections.
In the future
--
Move attachments to files, instead of storing as blobs in the database. There are tons of ways
we can make the app perform better with this small change. Primarily, we can do everything
pertaining to large attachments as streams instead of as large loads into byte arrays.
Get rid of the LocalStore's attachment to Store altogether. Local storage is too complex and
specific to performance to be bound to the Store API. It needs to be flexible with plenty of helper
functions to make best use of memory and resources.
Make better use of the abstractions for Body, Part and BodyPart. Proper use of these abstractions
can completely remove the need for the special headers.

View File

@ -0,0 +1,12 @@
apply plugin: 'checkstyle'
check.dependsOn 'checkstyle'
task checkstyle(type: Checkstyle) {
ignoreFailures = true
configFile file("$rootProject.projectDir/config/checkstyle/checkstyle.xml")
source = project.android.sourceSets.main.java.getSrcDirs() +
project.android.sourceSets.androidTest.java.getSrcDirs()
include '**/*.java'
classpath = files()
}

View File

@ -0,0 +1,14 @@
apply plugin: 'findbugs'
check.dependsOn 'findbugs'
task findbugs(type: FindBugs, dependsOn: ['compileDebugJava', 'compileDebugTestJava']) {
ignoreFailures = true
classes = fileTree('build/intermediates/classes/debug/') +
fileTree('build/intermediates/classes/test/debug/')
source = project.android.sourceSets.main.java.getSrcDirs() +
project.android.sourceSets.androidTest.java.getSrcDirs()
classpath = files()
effort = 'max'
includeFilter = file("$rootProject.projectDir/config/findbugs/include_filter.xml")
excludeFilter = file("$rootProject.projectDir/config/findbugs/exclude_filter.xml")
}

View File

@ -0,0 +1,43 @@
apply plugin: 'com.android.library'
apply from: '../gradle/plugins/checkstyle-android.gradle'
apply from: '../gradle/plugins/findbugs-android.gradle'
repositories {
jcenter()
}
dependencies {
compile 'org.apache.james:apache-mime4j-core:0.7.2'
compile 'org.apache.james:apache-mime4j-dom:0.7.2'
compile 'commons-io:commons-io:2.0.1'
compile 'com.jcraft:jzlib:1.0.7'
compile 'com.beetstra.jutf7:jutf7:1.0.0'
}
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
minSdkVersion 15
targetSdkVersion 17
}
lintOptions {
abortOnError false
lintConfig file("$rootProject.projectDir/config/lint/lint.xml")
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
}

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.fsck.k9.mail" />

View File

@ -2,7 +2,7 @@ package com.fsck.k9.mail;
import java.util.List;
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
import com.fsck.k9.mail.power.TracingPowerManager.TracingWakeLock;
import android.content.Context;

View File

@ -1,15 +1,19 @@
package com.fsck.k9.helper.power;
package com.fsck.k9.mail.power;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicInteger;
import com.fsck.k9.K9;
import com.fsck.k9.mail.K9MailLib;
import android.content.Context;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Log;
import static com.fsck.k9.mail.K9MailLib.LOG_TAG;
public class TracingPowerManager {
private final static boolean TRACE = false;
public static AtomicInteger wakeLockId = new AtomicInteger(0);
@ -20,8 +24,8 @@ public class TracingPowerManager {
public static synchronized TracingPowerManager getPowerManager(Context context) {
Context appContext = context.getApplicationContext();
if (tracingPowerManager == null) {
if (K9.DEBUG) {
Log.v(K9.LOG_TAG, "Creating TracingPowerManager");
if (K9MailLib.isDebug()) {
Log.v(LOG_TAG, "Creating TracingPowerManager");
}
tracingPowerManager = new TracingPowerManager(appContext);
}
@ -50,16 +54,16 @@ public class TracingPowerManager {
tag = ntag;
wakeLock = pm.newWakeLock(flags, tag);
id = wakeLockId.getAndIncrement();
if (K9.DEBUG) {
Log.v(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": Create");
if (K9MailLib.isDebug()) {
Log.v(LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": Create");
}
}
public void acquire(long timeout) {
synchronized (wakeLock) {
wakeLock.acquire(timeout);
}
if (K9.DEBUG) {
Log.v(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + " for " + timeout + " ms: acquired");
if (K9MailLib.isDebug()) {
Log.v(LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + " for " + timeout + " ms: acquired");
}
raiseNotification();
if (startTime == null) {
@ -72,8 +76,8 @@ public class TracingPowerManager {
wakeLock.acquire();
}
raiseNotification();
if (K9.DEBUG) {
Log.w(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": acquired with no timeout. K-9 Mail should not do this");
if (K9MailLib.isDebug()) {
Log.w(LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": acquired with no timeout. K-9 Mail should not do this");
}
if (startTime == null) {
startTime = System.currentTimeMillis();
@ -88,12 +92,12 @@ public class TracingPowerManager {
public void release() {
if (startTime != null) {
Long endTime = System.currentTimeMillis();
if (K9.DEBUG) {
Log.v(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": releasing after " + (endTime - startTime) + " ms, timeout = " + timeout + " ms");
if (K9MailLib.isDebug()) {
Log.v(LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": releasing after " + (endTime - startTime) + " ms, timeout = " + timeout + " ms");
}
} else {
if (K9.DEBUG) {
Log.v(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ", timeout = " + timeout + " ms: releasing");
if (K9MailLib.isDebug()) {
Log.v(LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ", timeout = " + timeout + " ms: releasing");
}
}
cancelNotification();
@ -123,11 +127,11 @@ public class TracingPowerManager {
public void run() {
if (startTime != null) {
Long endTime = System.currentTimeMillis();
Log.i(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": has been active for "
Log.i(LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": has been active for "
+ (endTime - startTime) + " ms, timeout = " + timeout + " ms");
} else {
Log.i(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": still active, timeout = " + timeout + " ms");
Log.i(LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": still active, timeout = " + timeout + " ms");
}
}

View File

@ -37,8 +37,8 @@ import android.os.PowerManager;
import android.text.TextUtils;
import android.util.Log;
import com.fsck.k9.helper.power.TracingPowerManager;
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
import com.fsck.k9.mail.power.TracingPowerManager;
import com.fsck.k9.mail.power.TracingPowerManager.TracingWakeLock;
import com.fsck.k9.mail.AuthType;
import com.fsck.k9.mail.Body;
import com.fsck.k9.mail.ConnectionSecurity;

78
k9mail/build.gradle Normal file
View File

@ -0,0 +1,78 @@
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply from: '../gradle/plugins/checkstyle-android.gradle'
apply from: '../gradle/plugins/findbugs-android.gradle'
repositories {
jcenter()
}
dependencies {
compile project(':k9mail-library')
compile project(':plugins:Android-PullToRefresh:library')
compile project(':plugins:HoloColorPicker')
compile project(':plugins:openpgp-api-library')
compile 'commons-io:commons-io:2.0.1'
compile 'com.android.support:support-v4:21.0.2'
compile 'com.android.support:support-v13:21.0.2'
compile 'net.sourceforge.htmlcleaner:htmlcleaner:2.2'
compile 'de.cketti.library.changelog:ckchangelog:1.2.1'
}
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
minSdkVersion 15
targetSdkVersion 17
}
signingConfigs {
release
}
buildTypes {
release {
if (project.hasProperty('storeFile')) {
signingConfig signingConfigs.release
}
}
debug {
testCoverageEnabled rootProject.testCoverage
}
}
// Do not abort build if lint finds errors
lintOptions {
abortOnError false
lintConfig file("$rootProject.projectDir/config/lint/lint.xml")
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
}
if (project.hasProperty('keyAlias')) {
android.signingConfigs.release.keyAlias = keyAlias
}
if (project.hasProperty('keyPassword')) {
android.signingConfigs.release.keyPassword = keyPassword
}
if (project.hasProperty('storeFile')) {
android.signingConfigs.release.storeFile = file(storeFile)
}
if (project.hasProperty('storePassword')) {
android.signingConfigs.release.storePassword = storePassword
}

Some files were not shown because too many files have changed in this diff Show More