Changelog update
[public/netxms.git] / build / next_build_number.pl
1 #!/usr/bin/perl
2
3 use File::Copy;
4
5 open my $in, '<', "build_number" or die "cannot open \"build_number\" file";
6 my $build = <$in>;
7 close $in;
8
9 $build++;
10 print "Setting build number to $build\n";
11
12 open my $out, '>', "build_number";
13 print $out "$build\n";
14 close $out;
15
16 open my $outh, '>', "../include/build.h" or die "cannot open build.h";
17 print $outh "#ifndef __build_h\n";
18 print $outh "#define __build_h\n";
19 print $outh "#define NETXMS_VERSION_BUILD $build\n";
20 print $outh "#define NETXMS_VERSION_BUILD_STRING _T(\"$build\")\n";
21 print $outh "#endif\n";
22 close $outh;
23
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: $!";
32
33 open my $outcmd, '>', "../src/java/build/set_build_number.cmd" or die "cannot open set_build_number.cmd";
34 print $outcmd "set build_number=$build\n";
35 close $outcmd;
36
37 open my $outsh, '>', "../src/java/build/set_build_number.sh" or die "cannot open set_build_number.sh";
38 print $outsh "build_number=$build\n";
39 close $outsh;
40
41 open my $outjava, '>', "../src/libnxjava/java/base/netxms-base/src/main/java/org/netxms/base/BuildNumber.java" or die "cannot open BuildNumber.java";
42 print $outjava "package org.netxms.base;\n";
43 print $outjava "public final class BuildNumber {\n";
44 print $outjava " public static final String TEXT = \"$build\";\n";
45 print $outjava " public static final int NUMBER = $build;\n";
46 print $outjava "}\n";
47 close $outjava;