summaryrefslogtreecommitdiffstats
path: root/vespa-http-client/src/main/bin/versiontagger.sh
blob: f4e4c23e50a72d31557a2e55e73ac4d26a29bd5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

# Extracts the current version number (V_TAG_COMPONENT) from vtag.map and outputs this into a Java class.
# This replaces vespajlib/../VersionTagger.java as this module cannot depend on that, nor the dependencies
# of the resulting class.
#
# Author: bratseth

source=$1
destination=$2
destinationDir=$(dirname $destination)

mkdir -p $destinationDir

versionNumber=$(cat $source | grep V_TAG_COMPONENT | awk '{print $2}' )

cat > $destination <<- END
package com.yahoo.vespa.http.client.core;

public class Vtag {
    public static final String V_TAG_COMPONENT = "$versionNumber";
}
END