Return-Path: X-Original-To: apmail-flume-commits-archive@www.apache.org Delivered-To: apmail-flume-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1F227F2B2 for ; Wed, 29 May 2013 16:05:42 +0000 (UTC) Received: (qmail 55014 invoked by uid 500); 29 May 2013 16:05:41 -0000 Delivered-To: apmail-flume-commits-archive@flume.apache.org Received: (qmail 54995 invoked by uid 500); 29 May 2013 16:05:41 -0000 Mailing-List: contact commits-help@flume.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flume.apache.org Delivered-To: mailing list commits@flume.apache.org Received: (qmail 54925 invoked by uid 99); 29 May 2013 16:05:41 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 May 2013 16:05:41 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DAEDC89CC7B; Wed, 29 May 2013 16:05:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brock@apache.org To: commits@flume.apache.org Message-Id: <9560cd7cc43f41a59e37c97d03348270@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: FLUME-2054: Support Version Info on Windows and fix failure of TestVersionInfo Date: Wed, 29 May 2013 16:05:40 +0000 (UTC) Updated Branches: refs/heads/flume-1.4 079039004 -> f9986bf37 FLUME-2054: Support Version Info on Windows and fix failure of TestVersionInfo (Roshan Naik via Brock Noland) Project: http://git-wip-us.apache.org/repos/asf/flume/repo Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/f9986bf3 Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/f9986bf3 Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/f9986bf3 Branch: refs/heads/flume-1.4 Commit: f9986bf37c5b05f1c41e2b09ae917d7c45a44a12 Parents: 0790390 Author: Brock Noland Authored: Wed May 29 11:04:49 2013 -0500 Committer: Brock Noland Committed: Wed May 29 11:04:59 2013 -0500 ---------------------------------------------------------------------- flume-ng-core/pom.xml | 58 ++++++++++++++++++++++++++ flume-ng-core/scripts/saveVersion.ps1 | 61 ++++++++++++++++++++++++++++ pom.xml | 8 ++++ 3 files changed, 127 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flume/blob/f9986bf3/flume-ng-core/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-core/pom.xml b/flume-ng-core/pom.xml index 20e975f..e37de5b 100644 --- a/flume-ng-core/pom.xml +++ b/flume-ng-core/pom.xml @@ -183,6 +183,64 @@ limitations under the License. + + + windows + + + Windows + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + generate-version + generate-sources + + + + + + + + + + run + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.7 + + + add-source + generate-sources + + add-source + + + + target/generated-sources/java + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/flume/blob/f9986bf3/flume-ng-core/scripts/saveVersion.ps1 ---------------------------------------------------------------------- diff --git a/flume-ng-core/scripts/saveVersion.ps1 b/flume-ng-core/scripts/saveVersion.ps1 new file mode 100644 index 0000000..dff8813 --- /dev/null +++ b/flume-ng-core/scripts/saveVersion.ps1 @@ -0,0 +1,61 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script is used to generate the annotation of package info that +# records the version, revision, branch, url, user and timestamp. + +$version=$args[0] +$buildDirectory=$args[1] +$outputFile= "$buildDirectory\generated-sources\java\org\apache\flume\package-info.java" +$user = $Env:username +$date = Get-Date + +cmd /c svn info 2>&1 | Out-Null +if ( $LastExitCode -eq 0 ) { + $revision=svn info | % { if( $_ -match "Last Changed Rev: (?.*)" ) { $matches['rev'];} } + $url=svn info | % { if( $_ -match "URL: (?.*)" ) { $matches['url'];} } + $branch= if( $url -match ".*(?(branches.*)|(tags.*)|(trunk.*))" ) { $matches['branch']; } else { "Unknown"; } +} +else { + cmd /c git rev-parse HEAD 2>&1 | Out-Null + if ( $LastExitCode -eq 0 ) { + $revision=$(git log -1 --pretty=format:"%H") + $branch=$(git name-rev --name-only HEAD) + $remote=$(git config branch.$branch.remote) + $url=$(git config remote.$remote.url) + } + else { + revision="Unknown" + branch="Unknown" + url="file://$cwd" + } +} + +$srcChecksum="N/A" + + +$fileContent = @" +/* + * Generated by scripts/saveVersion.ps1 + */ +@VersionAnnotation(version="$version", revision="$revision", branch="$branch", + user="$user", date="$date", url="$url", + srcChecksum="$srcChecksum") +package org.apache.flume; +"@ + +New-Item $outputFile -value $fileContent -force -type file + http://git-wip-us.apache.org/repos/asf/flume/blob/f9986bf3/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index a6992f6..5b6679c 100644 --- a/pom.xml +++ b/pom.xml @@ -163,6 +163,14 @@ limitations under the License. + + windows + + + Windows + + + sign