Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

HIVE-990. Incorporate CheckStyle into Hive's build.xml. (Carl Steinba…

…ch via zshao)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hive/trunk@901035 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 84a96667844810e9925598886201de444d9b60d4 1 parent 7d58e6b
@zshao zshao authored
View
3  CHANGES.txt
@@ -14,6 +14,9 @@ Trunk - Unreleased
HIVE-983. Function from_unixtime takes long.
(Ning Zhang via zshao)
+ HIVE-990. Incorporate CheckStyle into Hive's build.xml.
+ (Carl Steinbach via zshao)
+
OPTIMIZATIONS
BUG FIXES
View
118 build-common.xml
@@ -36,13 +36,6 @@
<property name="hadoop.conf.dir" location="${hadoop.root}/conf"/>
- <property name="javac.debug" value="on"/>
- <property name="javac.version" value="1.5"/>
- <property name="javac.optimize" value="on"/>
- <property name="javac.deprecation" value="off"/>
- <property name="javac.args" value=""/>
- <property name="javac.args.warnings" value=""/> <!-- -Xlint:unchecked"/ -->
-
<!-- configuration needed for tests -->
<property name="test.src.dir" value="${basedir}/src/test"/>
<property name="test.src.data.dir" value="${hive.root}/data"/>
@@ -69,19 +62,116 @@
<path refid="classpath"/>
</path>
- <import file="${hive.root}/ivy/get_ivy.xml"/>
+ <!-- IVY properties set here -->
+ <property name="build.ivy.dir" location="${build.dir.hive}/ivy"/>
+ <property name="build.ivy.lib.dir" location="${build.ivy.dir}/lib"/>
+ <property name="build.ivy.report.dir" location="${build.ivy.dir}/report"/>
+ <property name="build.ivy.maven.dir" location="${build.ivy.dir}/maven"/>
+ <condition property="ivy.home" value="${env.IVY_HOME}">
+ <isset property="env.IVY_HOME" />
+ </condition>
+ <property name="ivy.home" value="${user.home}/.ant" />
+ <property name="ivy.conf.dir" location="${hive.root}/ivy"/>
+ <loadproperties srcfile="${ivy.conf.dir}/libraries.properties"/>
+ <property name="ivy.jar" location="${build.ivy.lib.dir}/ivy-${ivy.version}.jar"/>
+ <property name="ivysettings.xml" location="${ivy.conf.dir}/ivysettings.xml" />
+ <property name="ivy.org" value="org.apache.hadoop"/>
+ <property name="mvn.repo" value="http://repo2.maven.org/maven2"/>
+ <property name="repo" value="snapshots"/>
+ <property name="asfrepo" value="https://repository.apache.org/content/repositories/${repo}"/>
+ <property name="ant_task_repo_url" value="${mvn.repo}/org/apache/maven/maven-ant-tasks/${ant-task.version}/maven-ant-tasks-${ant-task.version}.jar"/>
+ <property name="ivy_repo_url" value="${mvn.repo}/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"/>
+
+ <!--this is the naming policy for artifacts we want pulled down-->
+ <property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[conf]/[artifact]-[revision].[ext]"/>
+
+ <target name="ivy-init-dirs">
+ <mkdir dir="${build.ivy.dir}" />
+ <mkdir dir="${build.ivy.lib.dir}" />
+ <mkdir dir="${build.ivy.report.dir}" />
+ <mkdir dir="${build.ivy.maven.dir}" />
+ </target>
- <target name="settings-ivy" depends="init-ivy">
- <ivy:settings file="${hive.root}/ivy/ivysettings.xml"/>
+ <target name="ivy-probe-antlib" >
+ <condition property="ivy.found">
+ <typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
+ </condition>
</target>
- <target name="resolve" description="--> retrieve dependencies with ivy" depends="settings-ivy">
- <ivy:retrieve pattern="${build.dir.hadoop}/[artifact]-[revision].[ext]"/>
+ <target name="ivy-download" depends="ivy-init-dirs"
+ description="To download ivy" unless="offline">
+ <get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true"/>
</target>
- <available property="hadoopcore.${hadoop.version.ant-internal}.install.done" file="${build.dir.hadoop}/hadoop-${hadoop.version.ant-internal}.installed"/>
+ <!--
+ To avoid Ivy leaking things across big projects, always load Ivy in the same classloader.
+ Also note how we skip loading Ivy if it is already there, just to make sure all is well.
+ -->
+ <target name="ivy-init-antlib" depends="ivy-download,ivy-init-dirs,ivy-probe-antlib" unless="ivy.found">
+ <typedef uri="antlib:org.apache.ivy.ant" onerror="fail"
+ loaderRef="ivyLoader">
+ <classpath>
+ <pathelement location="${ivy.jar}"/>
+ </classpath>
+ </typedef>
+ <fail >
+ <condition >
+ <not>
+ <typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
+ </not>
+ </condition>
+ You need Apache Ivy 2.0 or later from http://ant.apache.org/
+ It could not be loaded from ${ivy_repo_url}
+ </fail>
+ </target>
+
+
+ <property name="ivyresolvelog" value="download-only"/>
+ <property name="ivyretrievelog" value="quite"/>
+
+ <target name="ivy-init" depends="ivy-init-antlib" >
+ <!--Configure Ivy by reading in the settings file
+ If anyone has already read in a settings file into this settings ID, it gets priority
+ -->
+ <ivy:settings id="${ant.project.name}.ivy.settings" file="${ivysettings.xml}"/>
+ </target>
+
+ <target name="ivy-resolve" depends="ivy-init">
+ <ivy:resolve settingsRef="${ant.project.name}.ivy.settings"
+ log="${ivyresolvelog}"/>
+ </target>
+
+ <target name="ivy-resolve-checkstyle" depends="ivy-init">
+ <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="checkstyle"
+ log="${ivyresolvelog}"/>
+ </target>
+
+ <target name="ivy-retrieve" depends="ivy-resolve"
+ description="Retrieve Ivy-managed artifacts">
+ <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
+ pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
+ log="${ivyresolvelog}"/>
+ </target>
+
+ <target name="ivy-retrieve-checkstyle" depends="ivy-resolve-checkstyle"
+ description="Retrieve Ivy-managed artifacts for the checkstyle configurations">
+ <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
+ pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
+ log="${ivyresolvelog}"/>
+ <ivy:cachepath pathid="checkstyle-classpath" conf="checkstyle"/>
+ </target>
+
+ <target name="ivy-retrieve-hadoop-source" depends="ivy-init"
+ description="Retrieve Ivy-managed Hadoop source artifacts" >
+ <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
+ pattern="${build.dir.hadoop}/[artifact]-[revision].[ext]"/>
+ </target>
+
+ <available property="hadoopcore.${hadoop.version.ant-internal}.install.done"
+ file="${build.dir.hadoop}/hadoop-${hadoop.version.ant-internal}.installed"/>
- <target name="install-hadoopcore-internal" depends="resolve" unless="hadoopcore.${hadoop.version.ant-internal}.install.done">
+ <target name="install-hadoopcore-internal" depends="ivy-retrieve-hadoop-source"
+ unless="hadoopcore.${hadoop.version.ant-internal}.install.done">
<untar src="${build.dir.hadoop}/hadoop-${hadoop.version.ant-internal}.tar.gz" dest="${build.dir.hadoop}" compression="gzip"/>
<chmod file="${hadoop.root}/bin/hadoop" perm="+x"/>
<touch file="${build.dir.hadoop}/hadoop-${hadoop.version.ant-internal}.installed"/>
View
7 build.properties
@@ -3,6 +3,13 @@ name=hive
version=0.6.0
year=2009
+javac.debug=on
+javac.version=1.6
+javac.optimize=on
+javac.deprecation=off
+javac.args=
+javac.args.warnings=
+
hadoop.version=0.20.0
hadoop.mirror=http://archive.apache.org/dist
View
50 build.xml
@@ -25,11 +25,6 @@
<property file="${user.home}/build.properties" />
<property file="${basedir}/build.properties" />
- <!-- This is the version added to the manifest, which must be manually rev'ed
- whenever a branch version is created. The non-numberic/dot characters are
- silently dropped from the Implementation-Version when added to the manifest. -->
- <property name="version" value="0.6.0-dev"/>
-
<property name="target.dir" location="${build.dir.hive}/dist"/>
<property name="target.lib.dir" location="${target.dir}/lib"/>
<property name="target.conf.dir" location="${target.dir}/conf"/>
@@ -48,6 +43,9 @@
<property name="final.name" value="${name}-${version}"/>
<property name="dev.final.name" value="${final.name}-dev"/>
<property name="bin.final.name" value="${final.name}-bin"/>
+ <property name="checkstyle.conf.dir" location="${hive.root}/checkstyle"/>
+ <property name="checkstyle.build.dir" location="${build.dir.hive}/checkstyle"/>
+
<!-- ====================================================== -->
<!-- Macro definitions -->
@@ -474,4 +472,46 @@
</macro_tar>
</target>
+
+ <!-- ================================================================== -->
+ <!-- Checkstyle -->
+ <!-- ================================================================== -->
+
+ <import file="${hive.root}/build-common.xml"/>
+
+ <target name="checkstyle" depends="ivy-retrieve-checkstyle,check-for-checkstyle"
+ if="checkstyle.present"
+ description="Run Checkstyle on source files">
+ <taskdef resource="checkstyletask.properties">
+ <classpath refid="checkstyle-classpath"/>
+ </taskdef>
+
+ <mkdir dir="${checkstyle.build.dir}"/>
+
+ <checkstyle config="${checkstyle.conf.dir}/checkstyle.xml"
+ failOnViolation="false">
+ <fileset dir="${hive.root}/cli/src" includes="**/*.java"/>
+ <fileset dir="${hive.root}/common/src" includes="**/*.java"/>
+ <fileset dir="${hive.root}/contrib/src/java" includes="**/*.java"/>
+ <fileset dir="${hive.root}/hwi/src/java" includes="**/*.java"/>
+ <fileset dir="${hive.root}/jdbc/src/java" includes="**/*.java"/>
+ <fileset dir="${hive.root}/metastore/src/java" includes="**/*.java"/>
+ <fileset dir="${hive.root}/ql/src/java" includes="**/*.java"/>
+ <fileset dir="${hive.root}/serde/src/java" includes="**/*.java"/>
+ <fileset dir="${hive.root}/service/src/java" includes="**/*.java"/>
+ <fileset dir="${hive.root}/shims/src" includes="**/*.java"/>
+ <formatter type="xml" toFile="${checkstyle.build.dir}/checkstyle-errors.xml"/>
+ </checkstyle>
+
+ <xslt style="${checkstyle.conf.dir}/checkstyle-noframes-sorted.xsl"
+ in="${checkstyle.build.dir}/checkstyle-errors.xml"
+ out="${checkstyle.build.dir}/checkstyle-errors.html"/>
+ </target>
+
+ <target name="check-for-checkstyle">
+ <available property="checkstyle.present" resource="checkstyletask.properties">
+ <classpath refid="checkstyle-classpath"/>
+ </available>
+ </target>
+
</project>
View
195 checkstyle/checkstyle-noframes-sorted.xsl
@@ -0,0 +1,195 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<!--
+ 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.
+-->
+
+<xsl:output method="html" indent="yes"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+<xsl:key name="files" match="file" use="@name" />
+
+<!-- Checkstyle XML Style Sheet by Stephane Bailliez <sbailliez@apache.org> -->
+<!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
+<!-- Usage (generates checkstyle_report.html): -->
+<!-- <checkstyle failonviolation="false" config="${check.config}"> -->
+<!-- <fileset dir="${src.dir}" includes="**/*.java"/> -->
+<!-- <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/> -->
+<!-- </checkstyle> -->
+<!-- <style basedir="${doc.dir}" destdir="${doc.dir}" -->
+<!-- includes="checkstyle_report.xml" -->
+<!-- style="${doc.dir}/checkstyle-noframes-sorted.xsl"/> -->
+
+<xsl:template match="checkstyle">
+ <html>
+ <head>
+ <style type="text/css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .a td {
+ background: #efefef;
+ }
+ .b td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <a name="top"></a>
+ <!-- jakarta logo -->
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td class="bannercell" rowspan="2">
+ <!--a href="http://jakarta.apache.org/">
+ <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
+ </a-->
+ </td>
+ <td class="text-align:right"><h2>CheckStyle Audit</h2></td>
+ </tr>
+ <tr>
+ <td class="text-align:right">Designed for use with <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+
+ <!-- Summary part -->
+ <xsl:apply-templates select="." mode="summary"/>
+ <hr size="1" width="100%" align="left"/>
+
+ <!-- Package List part -->
+ <xsl:apply-templates select="." mode="filelist"/>
+ <hr size="1" width="100%" align="left"/>
+
+ <!-- For each package create its part -->
+ <xsl:apply-templates select="file[@name and generate-id(.) = generate-id(key('files', @name))]" />
+
+ <hr size="1" width="100%" align="left"/>
+
+
+ </body>
+ </html>
+</xsl:template>
+
+
+
+ <xsl:template match="checkstyle" mode="filelist">
+ <h3>Files</h3>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Name</th>
+ <th>Errors</th>
+ </tr>
+ <xsl:for-each select="file[@name and generate-id(.) = generate-id(key('files', @name))]">
+ <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error)"/>
+ <xsl:variable name="errorCount" select="count(error)"/>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><a href="#f-{@name}"><xsl:value-of select="@name"/></a></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+
+ <xsl:template match="file">
+ <a name="f-{@name}"></a>
+ <h3>File <xsl:value-of select="@name"/></h3>
+
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Error Description</th>
+ <th>Line</th>
+ </tr>
+ <xsl:for-each select="key('files', @name)/error">
+ <xsl:sort data-type="number" order="ascending" select="@line"/>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="@message"/></td>
+ <td><xsl:value-of select="@line"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ <a href="#top">Back to top</a>
+ </xsl:template>
+
+
+ <xsl:template match="checkstyle" mode="summary">
+ <h3>Summary</h3>
+ <xsl:variable name="fileCount" select="count(file[@name and generate-id(.) = generate-id(key('files', @name))])"/>
+ <xsl:variable name="errorCount" select="count(file/error)"/>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Files</th>
+ <th>Errors</th>
+ </tr>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="$fileCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="alternated-row">
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
+ </xsl:attribute>
+ </xsl:template>
+</xsl:stylesheet>
+
+
View
190 checkstyle/checkstyle.xml
@@ -0,0 +1,190 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--
+
+ Checkstyle configuration for Hadoop that is based on the sun_checks.xml file
+ that is bundled with Checkstyle and includes checks for:
+
+ - the Java Language Specification at
+ http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+ - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+ - the Javadoc guidelines at
+ http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+ - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+ - some best practices
+
+ Checkstyle is very configurable. Be sure to read the documentation at
+ http://checkstyle.sf.net (or in your downloaded distribution).
+
+ Most Checks are configurable, be sure to consult the documentation.
+
+ To completely disable a check, just comment it out or delete it from the file.
+
+ Finally, it is worth reading the documentation.
+
+-->
+
+<module name="Checker">
+
+ <!-- Checks that a package.html file exists for each package. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
+ <module name="PackageHtml"/>
+
+ <!-- Checks whether files end with a new line. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+ <!-- module name="NewlineAtEndOfFile"/-->
+
+ <!-- Checks that property files contain the same keys. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+ <module name="Translation"/>
+
+
+ <module name="TreeWalker">
+
+ <!-- Checks for Javadoc comments. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+ <module name="JavadocType">
+ <property name="scope" value="public"/>
+ <property name="allowMissingParamTags" value="true"/>
+ </module>
+ <module name="JavadocStyle"/>
+
+ <!-- Checks for Naming Conventions. -->
+ <!-- See http://checkstyle.sf.net/config_naming.html -->
+ <module name="ConstantName"/>
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MemberName"/>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+
+
+ <!-- Checks for Headers -->
+ <!-- See http://checkstyle.sf.net/config_header.html -->
+ <!-- <module name="Header"> -->
+ <!-- The follow property value demonstrates the ability -->
+ <!-- to have access to ANT properties. In this case it uses -->
+ <!-- the ${basedir} property to allow Checkstyle to be run -->
+ <!-- from any directory within a project. See property -->
+ <!-- expansion, -->
+ <!-- http://checkstyle.sf.net/config.html#properties -->
+ <!-- <property -->
+ <!-- name="headerFile" -->
+ <!-- value="${basedir}/java.header"/> -->
+ <!-- </module> -->
+
+ <!-- Following interprets the header file as regular expressions. -->
+ <!-- <module name="RegexpHeader"/> -->
+
+
+ <!-- Checks for imports -->
+ <!-- See http://checkstyle.sf.net/config_import.html -->
+ <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+
+
+ <!-- Checks for Size Violations. -->
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->
+ <module name="FileLength"/>
+ <module name="LineLength">
+ <property name="max" value="100"/>
+ <property name="ignorePattern" value="^ *\* *[^ ]+$"/>
+ </module>
+ <module name="MethodLength"/>
+ <module name="ParameterNumber"/>
+
+
+ <!-- Checks for whitespace -->
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+ <module name="EmptyForIteratorPad"/>
+ <module name="MethodParamPad"/>
+ <module name="NoWhitespaceAfter"/>
+ <module name="NoWhitespaceBefore"/>
+ <module name="ParenPad"/>
+ <module name="TypecastParenPad"/>
+ <module name="TabCharacter"/>
+ <module name="WhitespaceAfter">
+ <property name="tokens" value="COMMA, SEMI"/>
+ </module>
+
+
+ <!-- Modifier Checks -->
+ <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+
+
+ <!-- Checks for blocks. You know, those {}'s -->
+ <!-- See http://checkstyle.sf.net/config_blocks.html -->
+ <module name="AvoidNestedBlocks"/>
+ <module name="EmptyBlock"/>
+ <module name="LeftCurly"/>
+ <module name="NeedBraces"/>
+ <module name="RightCurly"/>
+
+
+ <!-- Checks for common coding problems -->
+ <!-- See http://checkstyle.sf.net/config_coding.html -->
+ <!-- module name="AvoidInlineConditionals"/-->
+ <module name="DoubleCheckedLocking"/>
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="HiddenField">
+ <property name="ignoreConstructorParameter" value="true"/>
+ </module>
+ <module name="IllegalInstantiation"/>
+ <module name="InnerAssignment"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="RedundantThrows"/>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+
+ <!-- Checks for class design -->
+ <!-- See http://checkstyle.sf.net/config_design.html -->
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType"/>
+ <module name="VisibilityModifier"/>
+
+
+ <!-- Miscellaneous other checks. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html -->
+ <module name="ArrayTypeStyle"/>
+ <module name="Indentation">
+ <property name="basicOffset" value="2" />
+ <property name="caseIndent" value="0" />
+ </module>
+ <module name="TodoComment"/>
+ <module name="UpperEll"/>
+
+ </module>
+
+</module>
View
42 ivy.xml
@@ -0,0 +1,42 @@
+<!--
+ 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.
+-->
+
+<ivy-module version="2.0">
+ <info organisation="org.apache.hadoop.hive" module="${ant.project.name}" revision="${version}">
+ <license name="Apache 2.0"/>
+ <ivyauthor name="Apache Hive Team" url="http://hadoop.apache.org/hive"/>
+ <description>Apache Hive</description>
+ </info>
+
+ <configurations defaultconfmapping="default">
+ <!--these match the Maven configurations-->
+ <conf name="default" extends="master,runtime"/>
+ <conf name="master" description="contains the artifact but no dependencies"/>
+ <conf name="compile" description="contains the artifact but no dependencies"/>
+ <conf name="runtime" description="runtime but not the artifact"/>
+
+ <conf name="checkstyle" visibility="private"/>
+ </configurations>
+
+
+ <dependencies>
+ <dependency org="checkstyle" name="checkstyle" rev="${checkstyle.version}"
+ conf="checkstyle->default"/>
+ <conflict manager="all" />
+ </dependencies>
+
+</ivy-module>
View
90 ivy/ivysettings.xml
@@ -1,28 +1,76 @@
-<!--
-
- 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.
+<ivysettings>
+
+ <!--
+ 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.
-->
-<ivysettings>
- <settings defaultResolver="hadoop-resolver"/>
+ <!--
+ see http://www.jayasoft.org/ivy/doc/configuration
+ -->
+ <!-- you can override this property to use mirrors
+ http://repo1.maven.org/maven2/
+ http://mirrors.dotsrc.org/maven2
+ http://ftp.ggi-project.org/pub/packages/maven2
+ http://mirrors.sunsite.dk/maven2
+ http://public.planetmirror.com/pub/maven2
+ http://ibiblio.lsu.edu/main/pub/packages/maven2
+ http://www.ibiblio.net/pub/packages/maven2
+ -->
+
+ <property name="repo.maven.org" value="http://repo1.maven.org/maven2/" override="false"/>
+ <property name="snapshot.apache.org" value="https://repository.apache.org/content/repositories/snapshots/" override="false"/>
+ <property name="maven2.pattern" value="[organisation]/[module]/[revision]/[module]-[revision]"/>
+ <property name="repo.dir" value="${user.home}/.m2/repository"/>
+ <property name="maven2.pattern.ext" value="${maven2.pattern}.[ext]"/>
+ <property name="resolvers" value="default" override="false"/>
+ <settings defaultResolver="${resolvers}"/>
+
<resolvers>
- <url name="hadoop-resolver">
+ <url name="hadoop-source">
<artifact pattern="${hadoop.mirror}/hadoop/core/[artifact]-[revision]/[artifact]-[revision].[ext]" />
</url>
+
+ <ibiblio name="maven2" root="${repo.maven.org}" pattern="${maven2.pattern.ext}" m2compatible="true"/>
+ <ibiblio name="apache-snapshot" root="${snapshot.apache.org}" m2compatible="true"
+ checkmodified="true" changingPattern=".*SNAPSHOT"/>
+
+ <filesystem name="fs" m2compatible="true" force="true">
+ <artifact pattern="${repo.dir}/org/apache/hadoop/[module]/[revision]/[module]-[revision].[ext]"/>
+ <ivy pattern="${repo.dir}/org/apache/hadoop/[module]/[revision]/[module]-[revision].pom"/>
+ </filesystem>
+
+ <chain name="default" dual="true" checkmodified="true" changingPattern=".*SNAPSHOT">
+ <resolver ref="hadoop-source"/>
+ <resolver ref="apache-snapshot"/>
+ <resolver ref="maven2"/>
+ </chain>
+
+ <chain name="internal" dual="true">
+ <resolver ref="fs"/>
+ <resolver ref="apache-snapshot"/>
+ <resolver ref="maven2"/>
+ </chain>
+
+ <chain name="external">
+ <resolver ref="maven2"/>
+ </chain>
+
</resolvers>
+
+ <modules>
+ <module organisation="org.apache.hadoop" name="hadoop-*" resolver="${resolvers}"/>
+ </modules>
</ivysettings>
View
29 ivy/libraries.properties
@@ -0,0 +1,29 @@
+# Licensed 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 properties file lists the versions of the various artifacts used by hadoop and components.
+#It drives ivy and the generation of a maven POM
+
+#These are the versions of our dependencies (in alphabetical order)
+apacheant.version=1.7.1
+ant-task.version=2.0.10
+checkstyle.version=4.2
+commons-cli.version=2.0
+commons-codec.version=1.3
+commons-collections.version=3.2.1
+commons-lang.version=2.4
+commons-logging.version=1.0.4
+commons-logging-api.version=1.0.4
+ivy.version=2.0.0-rc2
+log4j.version=1.2.15
+
+
View
3  shims/build.xml
@@ -34,7 +34,8 @@ to call at top-level: ant deploy-contrib compile-core-test
</fileset>
</path>
- <target name="build_shims" description="Build shims against a particular hadoop version" depends="install-hadoopcore-internal, resolve">
+ <target name="build_shims" depends="install-hadoopcore-internal, ivy-retrieve-hadoop-source"
+ description="Build shims against a particular hadoop version">
<getversionpref property="hadoop.version.ant-internal.prefix" input="${hadoop.version.ant-internal}" />
<echo message="Compiling shims against hadoop ${hadoop.version.ant-internal} (${hadoop.root})"/>
<javac
Please sign in to comment.
Something went wrong with that request. Please try again.