1# Copyright (C) 2016 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16#
17# Build support for testng within the Android Open Source Project
18# See https://source.android.com/source/building.html for more information
19#
20#
21
22# This file generates Version.java.
23# Factored out as a separate file for reuse between multiple Android build rules.
24
25LOCAL_MODULE_CLASS := JAVA_LIBRARIES
26
27# Apply all of the Android patches in src/patches/android by running patch-android-src script on them.
28intermediates:= $(local-generated-sources-dir)
29GEN := $(addprefix $(intermediates)/, $(testng_src_files_need_gen)) # List of all files that need to be generated.
30$(GEN) : PRIVATE_PATH := $(testng_path)
31## ./generate-version-file ./src/main/resources/org/testng/internal/VersionTemplateJava "@version@" kobalt/src/Build.kt "VERSION" > Version.java
32$(GEN) : PRIVATE_CUSTOM_TOOL = \
33  $(PRIVATE_PATH)/generate-version-file "$(PRIVATE_PATH)/src/main/resources/org/testng/internal/VersionTemplateJava" \
34  "@version@" \
35  "$(PRIVATE_PATH)/kobalt/src/Build.kt" \
36  "VERSION" > $@
37$(GEN): $(intermediates)/%.java : $(LOCAL_PATH)/src/main/resources/org/testng/internal/VersionTemplateJava \
38  $(LOCAL_PATH)/kobalt/src/Build.kt \
39  $(LOCAL_PATH)/generate-version-file
40	$(transform-generated-source)
41LOCAL_GENERATED_SOURCES += $(GEN)
42
43