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