incubator-easyant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lalevée <nicolas.lale...@hibnet.org>
Subject Re: svn commit: r1373122 - in /incubator/easyant/plugins/trunk/offline: ./ module.ivy src/ src/main/ src/main/resources/ src/main/resources/offline.ant src/test/ src/test/antunit/ src/test/antunit/offline-test.xml src/test/antunit/sample-module.ivy
Date Tue, 14 Aug 2012 22:16:02 GMT
Hi,

I am stumbled.
As you know I really like the idea of having things put offline. But how could things work
within a plugin ? The plugins being supposed to be online, I would need to go online to go
offline ? Then after that the offline plugin being offlined itself, how could I go online
again to do some plugin update for instance ?

I have no doubt I probably missed something, could you explain how it works ? :)

Nicolas

Le 14 août 2012 à 23:23, jlboudart@apache.org a écrit :

> Author: jlboudart
> Date: Tue Aug 14 21:23:07 2012
> New Revision: 1373122
> 
> URL: http://svn.apache.org/viewvc?rev=1373122&view=rev
> Log:
> Add offline plugin with tests
> 
> Added:
>    incubator/easyant/plugins/trunk/offline/
>    incubator/easyant/plugins/trunk/offline/module.ivy
>    incubator/easyant/plugins/trunk/offline/src/
>    incubator/easyant/plugins/trunk/offline/src/main/
>    incubator/easyant/plugins/trunk/offline/src/main/resources/
>    incubator/easyant/plugins/trunk/offline/src/main/resources/offline.ant
>    incubator/easyant/plugins/trunk/offline/src/test/
>    incubator/easyant/plugins/trunk/offline/src/test/antunit/
>    incubator/easyant/plugins/trunk/offline/src/test/antunit/offline-test.xml
>    incubator/easyant/plugins/trunk/offline/src/test/antunit/sample-module.ivy
> 
> Added: incubator/easyant/plugins/trunk/offline/module.ivy
> URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/offline/module.ivy?rev=1373122&view=auto
> ==============================================================================
> --- incubator/easyant/plugins/trunk/offline/module.ivy (added)
> +++ incubator/easyant/plugins/trunk/offline/module.ivy Tue Aug 14 21:23:07 2012
> @@ -0,0 +1,31 @@
> +<!--
> +   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" xmlns:ea="http://www.easyant.org"> 
> +    <info organisation="org.apache.easyant.plugins" module="offline" revision="0.9">
> +           <description>This module offline features. You can define it as a system
plugin in easyant-conf.xml. Offline features will allow you to retrieve all project dependencies
and easyant modules (buildtypes, and plugins) used by the project in project in a subdirectory.</description>
> +           <ea:build organisation="org.apache.easyant.buildtypes" module="build-std-ant-plugin"
revision="0.1"/>
> +<ea:plugin module="antunit" revision="0.9"/>
> +        </info>
> +        <configurations>
> +                <conf name="default" description="runtime dependencies artifact can
be used with this conf"/>
> +                <conf name="test" description="this scope indicates that the dependency
is not required for normal use of the application, and is only available for the test compilation
and execution phases."/>
> +                <conf name="provided" description="this is much like compile, but
indicates you expect the JDK or a container to provide it. It is only available on the compilation
classpath, and is not transitive."/>
> +        </configurations>
> +    <publications>
> +        <artifact type="ant"/>
> +    </publications>
> +</ivy-module>
> 
> Added: incubator/easyant/plugins/trunk/offline/src/main/resources/offline.ant
> URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/offline/src/main/resources/offline.ant?rev=1373122&view=auto
> ==============================================================================
> --- incubator/easyant/plugins/trunk/offline/src/main/resources/offline.ant (added)
> +++ incubator/easyant/plugins/trunk/offline/src/main/resources/offline.ant Tue Aug 14
21:23:07 2012
> @@ -0,0 +1,50 @@
> +<!--
> +   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.
> +-->
> +<project name="org.apache.easyant.plugins#offline"
> +    xmlns:ivy="antlib:org.apache.ivy.ant"
> +    xmlns:ac="antlib:net.sf.antcontrib"
> +    xmlns:ea="antlib:org.apache.easyant">
> +
> +    <ea:core-version requiredrevision="[0.9,+]" />
> +
> +    <ea:parameter property="project.ivy.instance" default="project.ivy.instance"
description="the ivy instance name for your project" />
> +    <ea:parameter property="project.buildscope.resolver" default="project.buildscope.repository"
description="name of project build scope repository"/>
> +    <ea:parameter property="easyant.buildscope.resolver" default="easyant.buildscope.repository"
description="name of easyant build scope resolver"/>
> +    <ea:parameter property="easyant.offline" default="false" description="specify
if you're running easyant in offline mode"/>
> +
> +    <macrodef name="configure-build-repository">
> +         <attribute name="dictator" default="true"/>
> +         <sequential>
> +             <ea:configure-build-scoped-repository dictator="@{dictator}" name="${project.buildscope.resolver}"
settingsRef="${project.ivy.instance}"/>
> +             <ea:configure-build-scoped-repository dictator="@{dictator}" name="${easyant.buildscope.resolver}"
settingsRef="easyant.ivy.instance"/>
> +        </sequential>
> +    </macrodef>
> +    <ac:if>
> +        <istrue  value="${easyant.offline}"/>
> +        <ac:then>
> +             <configure-build-repository/>  
> +        </ac:then>
> +    </ac:if>
> +    
> +
> +    <target name="offline:go-offline">
> +        <configure-build-repository dictator="false"/>
> +     
> +        <ea:go-offline projectResolverName="${project.buildscope.resolver}" easyantResolverName="${easyant.buildscope.resolver}"/>
> +    </target>
> +
> +</project>
> 
> Added: incubator/easyant/plugins/trunk/offline/src/test/antunit/offline-test.xml
> URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/offline/src/test/antunit/offline-test.xml?rev=1373122&view=auto
> ==============================================================================
> --- incubator/easyant/plugins/trunk/offline/src/test/antunit/offline-test.xml (added)
> +++ incubator/easyant/plugins/trunk/offline/src/test/antunit/offline-test.xml Tue Aug
14 21:23:07 2012
> @@ -0,0 +1,71 @@
> +<!--
> +   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.
> +-->
> +<project name="org.apache.easyant.plugins;offline-test" 
> +    xmlns:au="antlib:org.apache.ant.antunit" 
> +    xmlns:ivy="antlib:org.apache.ivy.ant"
> +    xmlns:ea="antlib:org.apache.easyant">
> +    
> +    <!-- Import your plugin --> 
> +    <property name="target" value="${basedir}/target/test-antunit"/>
> +    <!-- configure easyant in current project -->
> +    <ea:configure-easyant-ivy-instance />
> +    <!-- import our local plugin -->
> +    <ea:import-test-module moduleIvy="../../../module.ivy" sourceDirectory="../../main/resources"/>
> +   
> +    <!-- Defines a setUp / tearDown (before each test) that cleans the environnement
--> 
> +    <target name="clean" description="remove stale build artifacts before / after
each test">
> +        <delete dir="${basedir}" includeemptydirs="true">
> +            <include name="**/target/**"/>
> +            <include name="**/lib/**"/>
> +        </delete>
> +    </target>
> +    
> +    <target name="setUp" depends="clean">
> +      <ivy:settings id="project.ivy.instance"/>
> +      <property name="easyant.file" value="${basedir}/sample-module.ivy"/>
> +    </target>
> +    <target name="tearDown" depends="clean"/>
> +    
> +    <target name="test-offline:init" >
> +        <au:assertPropertyEquals name="project.ivy.instance" value="project.ivy.instance"/>
> +        <au:assertPropertyEquals name="project.buildscope.resolver" value="project.buildscope.repository"/>
> +        <au:assertPropertyEquals name="easyant.buildscope.resolver" value="easyant.buildscope.repository"/>
> +        <au:assertPropertyEquals name="easyant.offline" value="false"/>
> +        <!--TODO: check if buildscope repository are registered -->
> +    </target>
> +
> +
> +    <target name="test-offline:offline:go-offline" depends="offline:go-offline">
> +        <!--TODO: check if buildscope repository are registered -->
> +        <au:assertLogContains text=":: installing junit#junit;4.4 ::" />
> +        <au:assertLogContains text=":: installing in project.buildscope.repository
::" />
> +        <au:assertLogContains text=":: installing org.apache.easyant.plugins#abstract-test;0.9
::" />
> +        <au:assertLogContains text=":: installing in easyant.buildscope.repository
::" />
> +        <au:assertLogContains text=":: installing org.apache.easyant.plugins#antunit;0.9
::" />
> +
> +        <property name="ea.repo" value="${target}/repository/easyant.buildscope.repository"/>
> +        <property name="project.repo" value="${target}/repository/project.buildscope.repository"/>
> +        <au:assertFileExists file="${ea.repo}"/>
> +        <au:assertFileExists file="${project.repo}"/>
> +        <au:assertFileExists file="${ea.repo}/org.apache.easyant.plugins/antunit/0.9/antunit.ant"/>
> +        <au:assertFileExists file="${ea.repo}/org.apache.easyant.plugins/antunit/0.9/antunit.ivy"/>
> +        <au:assertFileExists file="${project.repo}/junit/junit/4.4/junit.ivy"/>
> +        <au:assertFileExists file="${project.repo}/junit/junit/4.4/junit.jar"/>
> +    </target>
> +
> +    
> +</project>
> 
> Added: incubator/easyant/plugins/trunk/offline/src/test/antunit/sample-module.ivy
> URL: http://svn.apache.org/viewvc/incubator/easyant/plugins/trunk/offline/src/test/antunit/sample-module.ivy?rev=1373122&view=auto
> ==============================================================================
> --- incubator/easyant/plugins/trunk/offline/src/test/antunit/sample-module.ivy (added)
> +++ incubator/easyant/plugins/trunk/offline/src/test/antunit/sample-module.ivy Tue Aug
14 21:23:07 2012
> @@ -0,0 +1,27 @@
> +<?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.
> +-->
> +<ivy-module version="2.0" xmlns:ea="http://www.easyant.org"> 
> +    <info organisation="org.apache.easyant" module="standard-java-app" revision="0.1"
status="integration">
> +        <ea:plugin module="antunit" revision="0.9"/>
> +    </info>
> +    <dependencies> 
> +        <dependency org="junit" name="junit" rev="4.4"/>
> +            
> +    </dependencies>
> +
> +</ivy-module>
> 
> 


Mime
View raw message