Hack in support for the old version of Maven that Ubuntu apparently ships with

Change-Id: I39094627ff114901cc49f792ab601ab5b1677c19
This commit is contained in:
Chris Sarbora 2015-07-16 17:58:05 -07:00 committed by Gerrit Code Review
parent d5420c0638
commit 9bf517f89d

View File

@ -34,15 +34,34 @@ LOCAL_PREBUILT_MODULE_FILE := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS)
$(LOCAL_PREBUILT_MODULE_FILE): specifier := $(LOCAL_MAVEN_GROUP):$(LOCAL_MAVEN_ARTIFACT):$(LOCAL_MAVEN_VERSION):$(LOCAL_MAVEN_PACKAGING)$(if $(LOCAL_MAVEN_CLASSIFIER),:$(LOCAL_MAVEN_CLASSIFIER))
$(LOCAL_PREBUILT_MODULE_FILE): repo := $(LOCAL_MAVEN_REPO)
$(LOCAL_PREBUILT_MODULE_FILE):
@mvn -q dependency:get dependency:copy \
-DremoteRepositories=central::::$(repo) \
ifeq ($(shell mvn --version | head -1),Apache Maven 3.0.5)
copy_task :=
repo_param := -DrepoUrl=
output_param := -Ddestination=
$(LOCAL_PREBUILT_MODULE_FILE): nogroup_file := $(LOCAL_MAVEN_ARTIFACT)-$(LOCAL_MAVEN_VERSION)$(if $(LOCAL_MAVEN_CLASSIFIER),-$(LOCAL_MAVEN_CLASSIFIER)).$(LOCAL_MAVEN_PACKAGING)
$(LOCAL_PREBUILT_MODULE_FILE): copy_command := $(hide) cp ~/.m2/repository/$(subst .,/,$(LOCAL_MAVEN_GROUP))/$(LOCAL_MAVEN_ARTIFACT)/$(LOCAL_MAVEN_VERSION)/$(nogroup_file)
else
copy_task := dependency:copy
repo_param := -DremoteRepositories=central::::
output_param := -DoutputDirectory=
$(LOCAL_PREBUILT_MODULE_FILE): copy_command := $(hide) mvn -q dependency:copy \
-Dartifact=$(specifier) \
-DoutputDirectory=$(dir $@) \
-Dmdep.prependGroupId=true \
-Dmdep.overWriteSnapshots=true \
-Dmdep.overWriteReleases=true \
$(output_param)
$(LOCAL_PREBUILT_MODULE_FILE): nogroup_file := nonexistent
endif
$(LOCAL_PREBUILT_MODULE_FILE):
$(hide) mvn -q dependency:get \
$(repo_param)$(repo) \
-Dartifact=$(specifier) \
-Dtransitive=false
$(hide) mkdir -p $(dir $@)
$(copy_command)$(dir $@)
$(hide) mv $(dir $@)/$(nogroup_file) $@ 2>/dev/null || true
@echo -e ${CL_GRN}"Download:"${CL_RST}" $@"
include $(BUILD_PREBUILT)