You are viewing a plain text version of this content. The canonical link for it is here.
Posted to easyant-commits@incubator.apache.org by jl...@apache.org on 2012/08/14 21:23:07 UTC
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
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>
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
Posted by Jean-Louis Boudart <je...@gmail.com>.
Done :)
Offline mode is not activated by default, but if you want to do so you can
configure the property in easyant-conf.xml
2012/8/15 Nicolas Lalevée <ni...@hibnet.org>
>
> Le 15 août 2012 à 13:12, Jean-Louis Boudart a écrit :
>
> > I have one question through :
> > Should we register offline repositories all the time ? or should we
> > register it only when running easyant in offline mode / or juste before
> > calling go-offline ?
> >
> > If we took the first option : the repository will be declared but not
> > pluged in resolution chain and will not be activated as dictartor
> resolver
> > except when running offline.
>
> From my point of view, we should always run offline by default, but that
> might not be a consensus :p
>
> Maybe the first option is preferable, if a third party plugin want to
> explicitly work with it. No idea yet why somebody would do that, but who
> knows.
> Either way is fine with me actually.
>
> Nicolas
>
> >
> >
> >
> > 2012/8/15 Nicolas Lalevée <ni...@hibnet.org>
> >
> >>
> >> Le 15 août 2012 à 11:29, Jean-Louis Boudart a écrit :
> >>
> >>> As you pointed out, the feature can't work properly as a system plugin.
> >>> So let's modify a bit the behavior.
> >>>
> >>> Checking if you're running in offline mode and configuring buildscope
> >>> should be done by easyant core not by a plugin, before any
> >> buildtype/plugin
> >>> resolution.
> >>>
> >>> offline plugin can still live and provide the go-offline target.
> >>>
> >>>
> >>> WDYT?
> >>
> >> That sounds great !
> >>
> >> Thank you for the explanations.
> >>
> >> Nicolas
> >>
> >>
> >>>
> >>>
> >>> 2012/8/15 Jean-Louis Boudart <je...@gmail.com>
> >>>
> >>>> I initially developped this plugins thinking that it could be used as
> a
> >>>> system plugins. System plugins are loaded by easyant at startup and
> >>>> configured in easyant-config.xml, like skeleton and
> ivy-repo-management
> >>>> plugins.
> >>>>
> >>>> But i haven't tested it as a system plugin yet. For my tests i have
> >>>> declared a dependency on this plugin in my project and the feature
> seems
> >>>> working. As it is a project plugin it is marked to be fetched in the
> >> build
> >>>> scope repository.
> >>>>
> >>>> As explain in feature presentation mail [1], you need to be online
> when
> >>>> you choose to turn offline. Then plugins / buildtypes their
> dependencies
> >>>> , and your project dependencies are fetched in a subdirectory of your
> >>>> project target/repository, and build scope repositories are configured
> >> (one
> >>>> for project, one for easyant ivy instance).
> >>>>
> >>>> Those buildscope repositorues are used ONLY if you are running easyant
> >> in
> >>>> offline mode :
> >>>> * by invoking easyant -o
> >>>> * by invoking easyant --offline
> >>>> * by setting easyant.offline property to true
> >>>>
> >>>> So if you need to update dependencies, run easyant normally (without
> >>>> beeing offline), invoke go-offline target.
> >>>>
> >>>> Then you're free to take advantage of offline stuff :).
> >>>>
> >>>> I'll publish it on our online repo if you want to give a try.
> >>>> I see at least two things to fix :
> >>>> * The two buildscope repository used by offline feature should not be
> >>>> stored in target/ as this directory is removed if you invoke a clean.
> >>>> * offline plugins should work as a system-plugin
> >>>>
> >>>> Any suggestion are welcome
> >>>>
> >>>> [1] http://markmail.org/thread/nwjlpygjb3vgn2vn
> >>>> Le 15 août 2012 00:16, "Nicolas Lalevée" <ni...@hibnet.org>
> a
> >>>> écrit :
> >>>>
> >>>> 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>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>
> >>>
> >>> --
> >>> Jean Louis Boudart
> >>> Independent consultant
> >>> Apache EasyAnt commiter http://incubator.apache.org/easyant/
> >>
> >>
> >
> >
> > --
> > Jean Louis Boudart
> > Independent consultant
> > Apache EasyAnt commiter http://incubator.apache.org/easyant/
>
>
--
Jean Louis Boudart
Independent consultant
Apache EasyAnt commiter http://incubator.apache.org/easyant/
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
Posted by Nicolas Lalevée <ni...@hibnet.org>.
Le 15 août 2012 à 13:12, Jean-Louis Boudart a écrit :
> I have one question through :
> Should we register offline repositories all the time ? or should we
> register it only when running easyant in offline mode / or juste before
> calling go-offline ?
>
> If we took the first option : the repository will be declared but not
> pluged in resolution chain and will not be activated as dictartor resolver
> except when running offline.
From my point of view, we should always run offline by default, but that might not be a consensus :p
Maybe the first option is preferable, if a third party plugin want to explicitly work with it. No idea yet why somebody would do that, but who knows.
Either way is fine with me actually.
Nicolas
>
>
>
> 2012/8/15 Nicolas Lalevée <ni...@hibnet.org>
>
>>
>> Le 15 août 2012 à 11:29, Jean-Louis Boudart a écrit :
>>
>>> As you pointed out, the feature can't work properly as a system plugin.
>>> So let's modify a bit the behavior.
>>>
>>> Checking if you're running in offline mode and configuring buildscope
>>> should be done by easyant core not by a plugin, before any
>> buildtype/plugin
>>> resolution.
>>>
>>> offline plugin can still live and provide the go-offline target.
>>>
>>>
>>> WDYT?
>>
>> That sounds great !
>>
>> Thank you for the explanations.
>>
>> Nicolas
>>
>>
>>>
>>>
>>> 2012/8/15 Jean-Louis Boudart <je...@gmail.com>
>>>
>>>> I initially developped this plugins thinking that it could be used as a
>>>> system plugins. System plugins are loaded by easyant at startup and
>>>> configured in easyant-config.xml, like skeleton and ivy-repo-management
>>>> plugins.
>>>>
>>>> But i haven't tested it as a system plugin yet. For my tests i have
>>>> declared a dependency on this plugin in my project and the feature seems
>>>> working. As it is a project plugin it is marked to be fetched in the
>> build
>>>> scope repository.
>>>>
>>>> As explain in feature presentation mail [1], you need to be online when
>>>> you choose to turn offline. Then plugins / buildtypes their dependencies
>>>> , and your project dependencies are fetched in a subdirectory of your
>>>> project target/repository, and build scope repositories are configured
>> (one
>>>> for project, one for easyant ivy instance).
>>>>
>>>> Those buildscope repositorues are used ONLY if you are running easyant
>> in
>>>> offline mode :
>>>> * by invoking easyant -o
>>>> * by invoking easyant --offline
>>>> * by setting easyant.offline property to true
>>>>
>>>> So if you need to update dependencies, run easyant normally (without
>>>> beeing offline), invoke go-offline target.
>>>>
>>>> Then you're free to take advantage of offline stuff :).
>>>>
>>>> I'll publish it on our online repo if you want to give a try.
>>>> I see at least two things to fix :
>>>> * The two buildscope repository used by offline feature should not be
>>>> stored in target/ as this directory is removed if you invoke a clean.
>>>> * offline plugins should work as a system-plugin
>>>>
>>>> Any suggestion are welcome
>>>>
>>>> [1] http://markmail.org/thread/nwjlpygjb3vgn2vn
>>>> Le 15 août 2012 00:16, "Nicolas Lalevée" <ni...@hibnet.org> a
>>>> écrit :
>>>>
>>>> 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>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>
>>>
>>> --
>>> Jean Louis Boudart
>>> Independent consultant
>>> Apache EasyAnt commiter http://incubator.apache.org/easyant/
>>
>>
>
>
> --
> Jean Louis Boudart
> Independent consultant
> Apache EasyAnt commiter http://incubator.apache.org/easyant/
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
Posted by Jean-Louis Boudart <je...@gmail.com>.
I have one question through :
Should we register offline repositories all the time ? or should we
register it only when running easyant in offline mode / or juste before
calling go-offline ?
If we took the first option : the repository will be declared but not
pluged in resolution chain and will not be activated as dictartor resolver
except when running offline.
2012/8/15 Nicolas Lalevée <ni...@hibnet.org>
>
> Le 15 août 2012 à 11:29, Jean-Louis Boudart a écrit :
>
> > As you pointed out, the feature can't work properly as a system plugin.
> > So let's modify a bit the behavior.
> >
> > Checking if you're running in offline mode and configuring buildscope
> > should be done by easyant core not by a plugin, before any
> buildtype/plugin
> > resolution.
> >
> > offline plugin can still live and provide the go-offline target.
> >
> >
> > WDYT?
>
> That sounds great !
>
> Thank you for the explanations.
>
> Nicolas
>
>
> >
> >
> > 2012/8/15 Jean-Louis Boudart <je...@gmail.com>
> >
> >> I initially developped this plugins thinking that it could be used as a
> >> system plugins. System plugins are loaded by easyant at startup and
> >> configured in easyant-config.xml, like skeleton and ivy-repo-management
> >> plugins.
> >>
> >> But i haven't tested it as a system plugin yet. For my tests i have
> >> declared a dependency on this plugin in my project and the feature seems
> >> working. As it is a project plugin it is marked to be fetched in the
> build
> >> scope repository.
> >>
> >> As explain in feature presentation mail [1], you need to be online when
> >> you choose to turn offline. Then plugins / buildtypes their dependencies
> >> , and your project dependencies are fetched in a subdirectory of your
> >> project target/repository, and build scope repositories are configured
> (one
> >> for project, one for easyant ivy instance).
> >>
> >> Those buildscope repositorues are used ONLY if you are running easyant
> in
> >> offline mode :
> >> * by invoking easyant -o
> >> * by invoking easyant --offline
> >> * by setting easyant.offline property to true
> >>
> >> So if you need to update dependencies, run easyant normally (without
> >> beeing offline), invoke go-offline target.
> >>
> >> Then you're free to take advantage of offline stuff :).
> >>
> >> I'll publish it on our online repo if you want to give a try.
> >> I see at least two things to fix :
> >> * The two buildscope repository used by offline feature should not be
> >> stored in target/ as this directory is removed if you invoke a clean.
> >> * offline plugins should work as a system-plugin
> >>
> >> Any suggestion are welcome
> >>
> >> [1] http://markmail.org/thread/nwjlpygjb3vgn2vn
> >> Le 15 août 2012 00:16, "Nicolas Lalevée" <ni...@hibnet.org> a
> >> écrit :
> >>
> >> 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>
> >>>>
> >>>>
> >>>
> >>>
> >
> >
> > --
> > Jean Louis Boudart
> > Independent consultant
> > Apache EasyAnt commiter http://incubator.apache.org/easyant/
>
>
--
Jean Louis Boudart
Independent consultant
Apache EasyAnt commiter http://incubator.apache.org/easyant/
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
Posted by Nicolas Lalevée <ni...@hibnet.org>.
Le 15 août 2012 à 11:29, Jean-Louis Boudart a écrit :
> As you pointed out, the feature can't work properly as a system plugin.
> So let's modify a bit the behavior.
>
> Checking if you're running in offline mode and configuring buildscope
> should be done by easyant core not by a plugin, before any buildtype/plugin
> resolution.
>
> offline plugin can still live and provide the go-offline target.
>
>
> WDYT?
That sounds great !
Thank you for the explanations.
Nicolas
>
>
> 2012/8/15 Jean-Louis Boudart <je...@gmail.com>
>
>> I initially developped this plugins thinking that it could be used as a
>> system plugins. System plugins are loaded by easyant at startup and
>> configured in easyant-config.xml, like skeleton and ivy-repo-management
>> plugins.
>>
>> But i haven't tested it as a system plugin yet. For my tests i have
>> declared a dependency on this plugin in my project and the feature seems
>> working. As it is a project plugin it is marked to be fetched in the build
>> scope repository.
>>
>> As explain in feature presentation mail [1], you need to be online when
>> you choose to turn offline. Then plugins / buildtypes their dependencies
>> , and your project dependencies are fetched in a subdirectory of your
>> project target/repository, and build scope repositories are configured (one
>> for project, one for easyant ivy instance).
>>
>> Those buildscope repositorues are used ONLY if you are running easyant in
>> offline mode :
>> * by invoking easyant -o
>> * by invoking easyant --offline
>> * by setting easyant.offline property to true
>>
>> So if you need to update dependencies, run easyant normally (without
>> beeing offline), invoke go-offline target.
>>
>> Then you're free to take advantage of offline stuff :).
>>
>> I'll publish it on our online repo if you want to give a try.
>> I see at least two things to fix :
>> * The two buildscope repository used by offline feature should not be
>> stored in target/ as this directory is removed if you invoke a clean.
>> * offline plugins should work as a system-plugin
>>
>> Any suggestion are welcome
>>
>> [1] http://markmail.org/thread/nwjlpygjb3vgn2vn
>> Le 15 août 2012 00:16, "Nicolas Lalevée" <ni...@hibnet.org> a
>> écrit :
>>
>> 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>
>>>>
>>>>
>>>
>>>
>
>
> --
> Jean Louis Boudart
> Independent consultant
> Apache EasyAnt commiter http://incubator.apache.org/easyant/
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
Posted by Jean-Louis Boudart <je...@gmail.com>.
As you pointed out, the feature can't work properly as a system plugin.
So let's modify a bit the behavior.
Checking if you're running in offline mode and configuring buildscope
should be done by easyant core not by a plugin, before any buildtype/plugin
resolution.
offline plugin can still live and provide the go-offline target.
WDYT?
2012/8/15 Jean-Louis Boudart <je...@gmail.com>
> I initially developped this plugins thinking that it could be used as a
> system plugins. System plugins are loaded by easyant at startup and
> configured in easyant-config.xml, like skeleton and ivy-repo-management
> plugins.
>
> But i haven't tested it as a system plugin yet. For my tests i have
> declared a dependency on this plugin in my project and the feature seems
> working. As it is a project plugin it is marked to be fetched in the build
> scope repository.
>
> As explain in feature presentation mail [1], you need to be online when
> you choose to turn offline. Then plugins / buildtypes their dependencies
> , and your project dependencies are fetched in a subdirectory of your
> project target/repository, and build scope repositories are configured (one
> for project, one for easyant ivy instance).
>
> Those buildscope repositorues are used ONLY if you are running easyant in
> offline mode :
> * by invoking easyant -o
> * by invoking easyant --offline
> * by setting easyant.offline property to true
>
> So if you need to update dependencies, run easyant normally (without
> beeing offline), invoke go-offline target.
>
> Then you're free to take advantage of offline stuff :).
>
> I'll publish it on our online repo if you want to give a try.
> I see at least two things to fix :
> * The two buildscope repository used by offline feature should not be
> stored in target/ as this directory is removed if you invoke a clean.
> * offline plugins should work as a system-plugin
>
> Any suggestion are welcome
>
> [1] http://markmail.org/thread/nwjlpygjb3vgn2vn
> Le 15 août 2012 00:16, "Nicolas Lalevée" <ni...@hibnet.org> a
> écrit :
>
> 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>
>> >
>> >
>>
>>
--
Jean Louis Boudart
Independent consultant
Apache EasyAnt commiter http://incubator.apache.org/easyant/
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
Posted by Jean-Louis Boudart <je...@gmail.com>.
I initially developped this plugins thinking that it could be used as a
system plugins. System plugins are loaded by easyant at startup and
configured in easyant-config.xml, like skeleton and ivy-repo-management
plugins.
But i haven't tested it as a system plugin yet. For my tests i have
declared a dependency on this plugin in my project and the feature seems
working. As it is a project plugin it is marked to be fetched in the build
scope repository.
As explain in feature presentation mail [1], you need to be online when you
choose to turn offline. Then plugins / buildtypes their dependencies
, and your project dependencies are fetched in a subdirectory of your
project target/repository, and build scope repositories are configured (one
for project, one for easyant ivy instance).
Those buildscope repositorues are used ONLY if you are running easyant in
offline mode :
* by invoking easyant -o
* by invoking easyant --offline
* by setting easyant.offline property to true
So if you need to update dependencies, run easyant normally (without beeing
offline), invoke go-offline target.
Then you're free to take advantage of offline stuff :).
I'll publish it on our online repo if you want to give a try.
I see at least two things to fix :
* The two buildscope repository used by offline feature should not be
stored in target/ as this directory is removed if you invoke a clean.
* offline plugins should work as a system-plugin
Any suggestion are welcome
[1] http://markmail.org/thread/nwjlpygjb3vgn2vn
Le 15 août 2012 00:16, "Nicolas Lalevée" <ni...@hibnet.org> a
écrit :
> 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>
> >
> >
>
>
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
Posted by Nicolas Lalevée <ni...@hibnet.org>.
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>
>
>