Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 62357 invoked from network); 31 Oct 2008 04:45:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Oct 2008 04:45:58 -0000 Received: (qmail 15711 invoked by uid 500); 31 Oct 2008 04:46:04 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 15686 invoked by uid 500); 31 Oct 2008 04:46:04 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 15676 invoked by uid 99); 31 Oct 2008 04:46:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2008 21:46:04 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Oct 2008 04:44:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1C0E0238889D; Thu, 30 Oct 2008 21:45:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r709346 - in /ant/sandbox/javafront/src: etc/examples/AntUnitTest.java main/org/apache/ant/javafront/BuildFileBase.java Date: Fri, 31 Oct 2008 04:45:37 -0000 To: notifications@ant.apache.org From: bodewig@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081031044538.1C0E0238889D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bodewig Date: Thu Oct 30 21:45:37 2008 New Revision: 709346 URL: http://svn.apache.org/viewvc?rev=709346&view=rev Log: convenience base class Added: ant/sandbox/javafront/src/etc/examples/AntUnitTest.java (with props) ant/sandbox/javafront/src/main/org/apache/ant/javafront/BuildFileBase.java (with props) Added: ant/sandbox/javafront/src/etc/examples/AntUnitTest.java URL: http://svn.apache.org/viewvc/ant/sandbox/javafront/src/etc/examples/AntUnitTest.java?rev=709346&view=auto ============================================================================== --- ant/sandbox/javafront/src/etc/examples/AntUnitTest.java (added) +++ ant/sandbox/javafront/src/etc/examples/AntUnitTest.java Thu Oct 30 21:45:37 2008 @@ -0,0 +1,39 @@ +/* + * 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.ant.javafront.example; + +import org.apache.ant.javafront.BuildFileBase; +import org.apache.ant.javafront.annotations.AntProject; +import org.apache.ant.javafront.annotations.AntTarget; +import org.apache.tools.ant.Project; + +@AntProject(Name="example using AntUnit", BaseDir="../../..", + DefaultTarget="describe") +public class AntUnitTest extends BuildFileBase { + public AntUnitTest(Project p) { + super(p); + } + + @AntTarget(Description="describes this build file") + public void describe() { + build().newTag("echo") + .withAttribute("message", "${ant.version}").execute(); + build().newTag("echo") + .withNestedText("Demonstrates running an AntUnit test.").execute(); + } +} \ No newline at end of file Propchange: ant/sandbox/javafront/src/etc/examples/AntUnitTest.java ------------------------------------------------------------------------------ svn:eol-style = native Added: ant/sandbox/javafront/src/main/org/apache/ant/javafront/BuildFileBase.java URL: http://svn.apache.org/viewvc/ant/sandbox/javafront/src/main/org/apache/ant/javafront/BuildFileBase.java?rev=709346&view=auto ============================================================================== --- ant/sandbox/javafront/src/main/org/apache/ant/javafront/BuildFileBase.java (added) +++ ant/sandbox/javafront/src/main/org/apache/ant/javafront/BuildFileBase.java Thu Oct 30 21:45:37 2008 @@ -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. + * + */ +package org.apache.ant.javafront; + +import org.apache.ant.javafront.builder.TagBuilder; +import org.apache.tools.ant.Project; + +/** + * Convenience base class for build files, completely optional. + */ +public abstract class BuildFileBase { + private final Project project; + private final TagBuilder tagBuilder; + + protected BuildFileBase(Project p) { + project = p; + tagBuilder = TagBuilder.forProject(p); + } + + protected final Project getProject() { + return project; + } + + protected final TagBuilder build() { + return tagBuilder; + } +} \ No newline at end of file Propchange: ant/sandbox/javafront/src/main/org/apache/ant/javafront/BuildFileBase.java ------------------------------------------------------------------------------ svn:eol-style = native