From 21bdddae689e41fa1849acd9ec14cb68505b90a9 Mon Sep 17 00:00:00 2001 From: David Almilli Date: Wed, 25 Feb 2015 08:39:30 -0800 Subject: [PATCH] Updated content provider template to support ${applicationId} variable that is supported in the new manifest merger build tool. http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger --- .../jraf/androidcontentprovidergenerator/contentprovider.ftl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/org/jraf/androidcontentprovidergenerator/contentprovider.ftl b/src/main/resources/org/jraf/androidcontentprovidergenerator/contentprovider.ftl index fcdd915..b78ec57 100644 --- a/src/main/resources/org/jraf/androidcontentprovidergenerator/contentprovider.ftl +++ b/src/main/resources/org/jraf/androidcontentprovidergenerator/contentprovider.ftl @@ -29,7 +29,9 @@ public class ${config.providerClassName} extends BaseContentProvider { private static final String TYPE_CURSOR_ITEM = "vnd.android.cursor.item/"; private static final String TYPE_CURSOR_DIR = "vnd.android.cursor.dir/"; - public static final String AUTHORITY = "${config.authority}"; + <#assign authority = "\"" + config.authority?replace(r"${applicationId}", "\" + BuildConfig.APPLICATION_ID + \"") + "\""> + <#assign authority = authority?replace(r'^"* \+ (.*?)', r"$1", "r")?replace(r'(.*?) \+ "*$', r"$1", "r")> + public static final String AUTHORITY = ${authority}; public static final String CONTENT_URI_BASE = "content://" + AUTHORITY; <#assign i=0>