print "Distrib dir: $DistrDir\n";\r
\r
# Git clone\r
-my $GitBranch = get_git_branch();\r
+my $GitBranch = 'master';\r
my $GitRepo = get_git_repo();\r
print "Clone git: repo=$GitRepo, branch=$GitBranch\n";\r
`git clone -b $GitBranch $GitRepo $DistrDir`; # or die "Error cloning branch $GitBranch to $DistrDir\n";\r
`rm -fr $DistrDir/.git`;\r
`rm -f $DistrDir/.gitignore $DistrDir/tools/brush_cds.pl $DistrDir/tools/make_distrib.pl $DistrDir/tools/make_distrib.bat $DistrDir/doxygen/images.odp`;\r
\r
-print "make copyright...\n" ;\r
-makeCopyright($DistrDir);\r
-\r
print "patch files...\n";\r
patch_file("$DistrDir/build/Makefile", 'VERSION=\d+\.\d+\.\d+', "VERSION=$Version" );\r
patch_file("$DistrDir/CMakeList.txt", 'PROJECT_VERSION \d+\.\d+\.\d+', "PROJECT_VERSION $Version" );\r
patch_file("$DistrDir/doxygen/cds.doxy", 'PROJECT_NUMBER\s*=\s*\d+\.\d+\.\d+', "PROJECT_NUMBER = $Version" ) ;\r
-patch_file("$DistrDir/projects/android/jni/Android.mk", 'CDS_LIBRARY_VERSION\s*:=\s*\d+\.\d+\.\d+', \r
- "CDS_LIBRARY_VERSION := $Version" );\r
\r
print "Make docs\n";\r
`cd $DistrDir/tools && make_docs.bat && rm doxygen.log && cd $curDir`;\r
\r
sub get_git_repo()\r
{\r
- return 'git@github.com:khizmax/libcds.git';\r
-}\r
-\r
-sub get_git_branch()\r
-{\r
- my $branchList = `git branch`;\r
- #print "$branchList\n";\r
- \r
- # Search "v$Version-rc" branch\r
- my ($branch) = $branchList =~ /(v$Version-rc\d*)/g;\r
- return $branch || 'master';\r
-}\r
-\r
-sub makeCopyright($) \r
-{\r
- my $distrDir = shift;\r
- processDir( "$distrDir/cds" ) ;\r
- processDir( "$distrDir/src" ) ;\r
- processDir( "$distrDir/tests/test-hdr" ) ;\r
- processDir( "$distrDir/tests/unit" ) ;\r
- processDir( "$distrDir/tests/cppunit" ) ;\r
-}\r
-\r
-sub processDir( $ )\r
-{\r
- my $dirName = shift ;\r
- \r
- opendir(my $dh, $dirName) || die "can't opendir $dirName: $!";\r
- my @files = grep { /^[^\.]/ } readdir($dh);\r
- closedir $dh;\r
- \r
- foreach my $file ( @files ) {\r
- if ( -d "$dirName/$file" ) {\r
- processDir("$dirName/$file") ;\r
- }\r
- elsif ( $file =~ /\.(h|cpp)$/ ) {\r
- processFile( "$dirName/$file" ) ;\r
- }\r
- }\r
-}\r
-\r
-sub processFile( $ ) \r
-{\r
- my $file = shift ;\r
-\r
- \r
- if ( open( my $fh, $file )) {\r
- binmode $fh ;\r
- my $str = '' ;\r
- while (<$fh>) {\r
- if ( /^\/\/\$\$CDS-header\$\$/ ) {\r
- $str .= \r
-"/*\r
- This file is a part of libcds - Concurrent Data Structures library\r
- Version: $Version\r
-\r
- (C) Copyright Maxim Khizhinsky (libcds.dev\@gmail.com) 2006-$year\r
- Distributed under the BSD license (see accompanying file LICENSE)\r
-\r
- Source code repo: http://github.com/khizmax/libcds/\r
- Download: http://sourceforge.net/projects/libcds/files/\r
-*/\n" ;\r
- }\r
- elsif ( /^\/\/\$\$CDS-\/\*\$\$/ ) {\r
- $str .= "/*\n" ;\r
- }\r
- elsif ( /^\/\/\$\$CDS-\*\/\$\$/ ) {\r
- $str .= "*/\n" ;\r
- }\r
- else {\r
- $nTabsFound += $_ =~ s/\t/ /g;\r
- $_ =~ s/\s+$// ;\r
- $_ =~ s/\s+;$/;/;\r
- $str .= $_ ;\r
- $str .= "\n" ;\r
- }\r
- }\r
- close $fh ;\r
- \r
- if ( open( my $fh, ">$file" )) {\r
- binmode $fh ;\r
- print $fh $str ;\r
- close $fh ;\r
- }\r
- }\r
+ return 'https://github.com/khizmax/libcds.git';\r
}\r
\r
sub patch_file(@) {\r