Changelog update
[public/netxms.git] / build / next_build_number.pl
CommitLineData
bfdba2df
VK
1#!/usr/bin/perl
2
3use File::Copy;
4
5open my $in, '<', "build_number" or die "cannot open \"build_number\" file";
6my $build = <$in>;
7close $in;
8
9$build++;
10print "Setting build number to $build\n";
11
12open my $out, '>', "build_number";
13print $out "$build\n";
14close $out;
15
16open my $outh, '>', "../include/build.h" or die "cannot open build.h";
17print $outh "#ifndef __build_h\n";
18print $outh "#define __build_h\n";
19print $outh "#define NETXMS_VERSION_BUILD $build\n";
20print $outh "#define NETXMS_VERSION_BUILD_STRING _T(\"$build\")\n";
21print $outh "#endif\n";
22close $outh;
23
4448945d
VK
24#open my $outxml, '>', "../android/src/console/res/values/build_number.xml" or die "cannot open build_number.xml";
25#print $outxml "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
26#print $outxml "<resources>\n";
27#print $outxml "\t<string name=\"build_number\">$build</string>\n";
28#print $outxml "</resources>\n";
29#close $outxml;
30
31#copy("../android/src/console/res/values/build_number.xml","../android/src/agent/res/values/build_number.xml") or die "Copy failed: $!";
bfdba2df
VK
32
33open my $outcmd, '>', "../src/java/build/set_build_number.cmd" or die "cannot open set_build_number.cmd";
34print $outcmd "set build_number=$build\n";
35close $outcmd;
3eb61c65 36
429100a5
VK
37open my $outsh, '>', "../src/java/build/set_build_number.sh" or die "cannot open set_build_number.sh";
38print $outsh "build_number=$build\n";
39close $outsh;
40
738d3f5f 41open my $outjava, '>', "../src/libnxjava/java/base/netxms-base/src/main/java/org/netxms/base/BuildNumber.java" or die "cannot open BuildNumber.java";
3eb61c65
VK
42print $outjava "package org.netxms.base;\n";
43print $outjava "public final class BuildNumber {\n";
44print $outjava " public static final String TEXT = \"$build\";\n";
45print $outjava " public static final int NUMBER = $build;\n";
46print $outjava "}\n";
47close $outjava;