From 44716fb0eefb1864aaa12b412ace0985e1904436 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Wed, 5 Aug 2015 17:03:06 -0700 Subject: [PATCH] vendor/cm: Provide means of uploading an artifact to maven. Change-Id: Ide225d75807a917773520ae1b7772e8de9b1ab73 --- build/core/config.mk | 1 + build/core/maven_artifact_publish.mk | 48 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 build/core/maven_artifact_publish.mk diff --git a/build/core/config.mk b/build/core/config.mk index 3f6e0a27..e3b19487 100644 --- a/build/core/config.mk +++ b/build/core/config.mk @@ -24,3 +24,4 @@ FRAMEWORK_CM_PLATFORM_SYSTEM_API_FILE := $(TOPDIR)vendor/cmsdk/system-api/cm_sys FRAMEWORK_CM_PLATFORM_SYSTEM_REMOVED_API_FILE := $(TOPDIR)vendor/cmsdk/system-api/cm_system-removed.txt BUILD_MAVEN_PREBUILT := $(TOP)/vendor/cm/build/core/maven_artifact.mk +PUBLISH_MAVEN_PREBUILT := $(TOP)/vendor/cm/build/core/maven_artifact_publish.mk diff --git a/build/core/maven_artifact_publish.mk b/build/core/maven_artifact_publish.mk new file mode 100644 index 00000000..e9359926 --- /dev/null +++ b/build/core/maven_artifact_publish.mk @@ -0,0 +1,48 @@ +# Copyright (C) 2015 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +full_target := $(call doc-timestamp-for,$(LOCAL_MODULE)) + +ifeq ($(strip $(LOCAL_MAVEN_POM)),) + $(error LOCAL_MAVEN_POM not defined.) +endif +ifeq ($(strip $(LOCAL_MAVEN_REPO)),) + $(error LOCAL_MAVEN_REPO not defined.) +endif +ifeq ($(strip $(LOCAL_MAVEN_FILE_PATH)),) + $(error LOCAL_MAVEN_FILE_PATH not defined.) +endif +ifeq ($(strip $(LOCAL_MAVEN_REPO_ID)),) + $(error LOCAL_MAVEN_REPO_ID not defined.) +endif +ifeq ($(strip $(LOCAL_MAVEN_CLASSIFIER)),) + $(info classifier not set) +endif + +$(full_target): pomfile := $(LOCAL_MAVEN_POM) +$(full_target): repo := $(LOCAL_MAVEN_REPO) +$(full_target): path_to_file := $(LOCAL_MAVEN_FILE_PATH) +$(full_target): repoId := $(LOCAL_MAVEN_REPO_ID) +$(full_target): classifier := $(LOCAL_MAVEN_CLASSIFIER) + +$(full_target): + $(hide) mvn -e -X deploy:deploy-file \ + -DpomFile=$(pomfile) \ + -Durl=$(repo) \ + -Dfile=$(path_to_file) \ + -DrepositoryId=$(repoId) \ + -Dclassifier=$(classifier) + @echo -e ${CL_GRN}"Publishing:"${CL_RST}" $@" + +$(LOCAL_MODULE) : $(full_target) \ No newline at end of file