aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client/src/main/sh/vespa-version-generator.sh
blob: 44fb7d167dbef4c82fc7f7f50d11ac0ca05360e0 (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
#!/usr/bin/env 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: bjorncs

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

mkdir -p $destinationDir

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

cat > $destination <<- END
package ai.vespa.feed.client.impl;

class Vespa {
    static final String VERSION = "$versionNumber";
}
END