/** * 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. */ package org.apache.hadoop.record.compiler.ant; import java.io.File; import java.util.ArrayList; import org.apache.hadoop.record.compiler.generated.Rcc; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; /** * Hadoop record compiler ant Task *
This task takes the given record definition files and compiles them into * java or c++ * files. It is then up to the user to compile the generated files. * *
The task requires the file
or the nested fileset element to be
* specified. Optional attributes are language
(set the output
* language, default is "java"),
* destdir
(name of the destination directory for generated java/c++
* code, default is ".") and failonerror
(specifies error handling
* behavior. default is true).
*
* <recordcc * destdir="${basedir}/gensrc" * language="java"> * <fileset include="**\/*.jr" /> * </recordcc> **/ public class RccTask extends Task { private String language = "java"; private File src; private File dest = new File("."); private final ArrayList