You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by "Jan Matèrne (JIRA)" <ji...@apache.org> on 2007/09/24 13:06:50 UTC
[jira] Issue Comment Edited: (IVY-608) Add support for importing
environment variables
[ https://issues.apache.org/jira/browse/IVY-608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529849 ]
jhm edited comment on IVY-608 at 9/24/07 6:05 AM:
----------------------------------------------------------
Regarding the maintenance of Ant code ... some thoughts ...
{code:title=EnvironmentLoading}
interface EnvironmentLoader {
Map getEnvironment();
}
abstract class EnvironmentLoader {
EnvironmentLoader getEnvLoader() {
// 1. check for Java5, then return the Java5EnvLoader
// 2. check if Ants <property> is on classpath; then use AntEnvLoader
// 3. other implementations?
// NoEnvLoader
}
}
public class NoEnvironmentLoader implements EnvironmentLoader {
Map getEnvironment() {
// error statements
// maybe an exception?
}
}
public class AntEnvironmentLoader implements EnvironmentLoader {
Map getEnvironment() {
oata.taskdefs.Properties propTask = new ...
// some more configuration needed?
propTask.setEnvironment("env");
propTask.execute();
// read the env key-value pairs
return ...
}
}
public class Java5EnvLoader implements EnvironmentLoader {
Map getEnvironment() {
// based on Jings implementation
}
}
{code}
was (Author: jhm):
Regarding the maintenance of Ant code ... some thoughts ...
interface EnvironmentLoader {
Map getEnvironment();
}
abstract class EnvLoaderFactory {
EnvironmentLoader getEnvLoader() {
// 1. check for Java5, then return the Java5EnvLoader
// 2. check if Ants <property> is on classpath; then use AntEnvLoader
// 3. other implementations?
// NoEnvLoader
}
}
interface EnvironmentLoader {
Map getEnvironment();
}
public class NoEnvironmentLoader implements EnvironmentLoader {
Map getEnvironment() {
// error statements
// maybe an exception?
}
}
public class AntEnvironmentLoader implements EnvironmentLoader {
Map getEnvironment() {
oata.taskdefs.Properties propTask = new ...
// some more configuration needed?
propTask.setEnvironment("env");
propTask.execute();
// read the env key-value pairs
return ...
}
}
public class Java5EnvLoader implements EnvironmentLoader {
Map getEnvironment() {
// based on Jings implementation
}
}
> Add support for importing environment variables
> -----------------------------------------------
>
> Key: IVY-608
> URL: https://issues.apache.org/jira/browse/IVY-608
> Project: Ivy
> Issue Type: New Feature
> Components: Core
> Affects Versions: 2.0.0-alpha-2
> Reporter: Jing Xue
> Priority: Minor
> Attachments: import-env-1.patch
>
>
> Ant supports importing environment variables into properties via the <properties environment="env" /> task. If an ivysettings.xml relies on an environment variable, the lack of support for this feature in Ivy makes it difficult to reuse the same ivysettings.xml in a non-Ant environment, such as in IvyDE. I'm submitting a patch to add the support for JDK 1.5+. This implementation will throw an exception when running in lesser JVMs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.