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 18:41:26 UTC
svn commit: r1373017 - in
/incubator/easyant/core/trunk/src/main/java/org/apache/easyant:
core/EasyAntConstants.java core/ant/MetaBuildExecutor.java
tasks/ConfigureBuildScopedRepository.java tasks/LoadModule.java
Author: jlboudart
Date: Tue Aug 14 18:41:25 2012
New Revision: 1373017
URL: http://svn.apache.org/viewvc?rev=1373017&view=rev
Log:
No need to register buildscope repository in property, name is specified as parameter of the task, and we can have multiple buildscoperepository
Modified:
incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConstants.java
incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/MetaBuildExecutor.java
incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ConfigureBuildScopedRepository.java
incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConstants.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConstants.java?rev=1373017&r1=1373016&r2=1373017&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConstants.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntConstants.java Tue Aug 14 18:41:25 2012
@@ -17,24 +17,23 @@
*/
package org.apache.easyant.core;
-
public interface EasyAntConstants {
-
+
/**
* Name of the task name used for internal easyant jobs
*/
public static final String EASYANT_TASK_NAME = "easyant";
-
+
/**
* Name of the default build module
*/
public static final String DEFAULT_BUILD_MODULE = "module.ivy";
-
+
/**
* Name of the default build file
*/
public static final String DEFAULT_BUILD_FILE = "module.ant";
-
+
/**
* Name of the default override build file
*/
@@ -54,12 +53,12 @@ public interface EasyAntConstants {
* Name of the default easyant plugins organisation
*/
public static final String EASYANT_PLUGIN_ORGANISATION = "org.apache.easyant.plugins";
-
+
/**
* Name of the default easyant build types organisation
*/
public static final String EASYANT_BUILDTYPES_ORGANISATION = "org.apache.easyant.buildtypes";
-
+
/**
* Name of the default easyant skeletons organisation
*/
@@ -79,6 +78,10 @@ public interface EasyAntConstants {
* Default value for pre module targets
*/
public static final String DEFAULT_PRE_MODULE_TARGETS = "clean";
-
+
+ /**
+ * Default build scope repository name
+ */
+ public static final String BUILD_SCOPE_REPOSITORY = "project-build";
}
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/MetaBuildExecutor.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/MetaBuildExecutor.java?rev=1373017&r1=1373016&r2=1373017&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/MetaBuildExecutor.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/MetaBuildExecutor.java Tue Aug 14 18:41:25 2012
@@ -29,7 +29,6 @@ import org.apache.easyant.core.ant.liste
import org.apache.easyant.core.ant.listerners.BuildExecutionTimer.ExecutionResult;
import org.apache.easyant.core.ant.listerners.SubBuildExecutionTimer;
import org.apache.easyant.core.ivy.IvyInstanceHelper;
-import org.apache.easyant.tasks.ConfigureBuildScopedRepository;
import org.apache.easyant.tasks.SubModule;
import org.apache.easyant.tasks.SubModule.TargetList;
import org.apache.ivy.ant.IvyAntSettings;
@@ -64,7 +63,7 @@ public class MetaBuildExecutor extends D
// repository, so that it can
// be used by submodules if needed
File moduleFile = new File(project.getBaseDir(), "module.ivy");
- String buildRepo = ConfigureBuildScopedRepository.getProjectBuildScopeRepositoryName(project);
+ String buildRepo = EasyAntConstants.BUILD_SCOPE_REPOSITORY;
if (moduleFile.isFile() && buildRepo != null) {
project.log("Publishing module descriptor " + moduleFile.getPath()
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ConfigureBuildScopedRepository.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ConfigureBuildScopedRepository.java?rev=1373017&r1=1373016&r2=1373017&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ConfigureBuildScopedRepository.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ConfigureBuildScopedRepository.java Tue Aug 14 18:41:25 2012
@@ -145,6 +145,8 @@ public class ConfigureBuildScopedReposit
getProject().log("Registering build scoped repository in " + DEFAULT_BUILD_SCOPED_REPOSITORY_DIR,
Project.MSG_DEBUG);
final String CACHENAME = "build-scoped-cache-" + buildScopeRepositoryName;
+ log("Registering build scope repository : " + getName() + " in " + DEFAULT_BUILD_SCOPED_REPOSITORY_DIR,
+ Project.MSG_DEBUG);
// Get the project ivy instance
IvySettings settings = getSettings();
@@ -188,31 +190,16 @@ public class ConfigureBuildScopedReposit
settings.addResolver(resolver);
}
settings.addResolver(buildRepository);
-
- getProject().setProperty(getProjectBuildScopeRepositoryName(getProject()), buildRepository.getName());
-
+ log(getName() + " registration succeed", Project.MSG_DEBUG);
}
/**
* Build default repository name
+ *
* @return repository name
*/
private String buildRepositoryName() {
return "build." + IvyInstanceHelper.getProjectIvyInstanceName(getProject());
}
- /**
- * Get project build scope repository name
- * @param project {@link Project} where build scope is registered
- * @return repository name
- */
- public static String getProjectBuildScopeRepositoryName(Project project) {
- String repoName = project.getProperty(EasyAntMagicNames.EASYANT_BUILD_REPOSITORY);
- if (repoName == null) {
- repoName = EasyAntMagicNames.EASYANT_BUILD_REPOSITORY + "."
- + IvyInstanceHelper.getProjectIvyInstanceName(project);
- }
- return repoName;
- }
-
}
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java?rev=1373017&r1=1373016&r2=1373017&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java Tue Aug 14 18:41:25 2012
@@ -443,7 +443,9 @@ public class LoadModule extends Abstract
*/
private void configureBuildRepository(IvyAntSettings projectSettings)
throws BuildException {
- initTask(new ConfigureBuildScopedRepository()).execute();
+ ConfigureBuildScopedRepository configureBuildScopedRepository = new ConfigureBuildScopedRepository();
+ configureBuildScopedRepository.setName(EasyAntConstants.BUILD_SCOPE_REPOSITORY);
+ initTask(configureBuildScopedRepository).execute();
}
}