Merged revisions 9727,9739,9765-9766,9927,10332,10334-10338,10340,10416,10421,10553,10839-10845,10876 via svnmerge from

https://www.dev.java.net/svn/hudson/branches/tom

........
  r9727 | huybrechts | 2008-05-31 12:49:18 -0700 (Sat, 31 May 2008) | 3 lines
  
  Issue 1659
  - cleaning up static Trigger, Hudson instances
  - resetting commons-logging
........
  r9739 | huybrechts | 2008-06-01 12:05:51 -0700 (Sun, 01 Jun 2008) | 1 line
  
  #1770 catching and logging InstantiationError
........
  r9765 | huybrechts | 2008-06-02 11:34:45 -0700 (Mon, 02 Jun 2008) | 1 line
  
  project-based security: fixed a new isAdmin call
........
  r9766 | huybrechts | 2008-06-02 11:35:27 -0700 (Mon, 02 Jun 2008) | 1 line
  
  "theInstance = null" caused some reloading problems
........
  r9927 | huybrechts | 2008-06-07 15:31:20 -0700 (Sat, 07 Jun 2008) | 8 lines
  
  Initial commit of parameterized builds. Provided functionality:
  - users can define parameters per project (only string paramters for now)
  - if a project has parameters, the 'build' button will redirect to an input page
  - parameter values can be used as ${variable} in Ant, Maven and CommandInterpreter builders
  - after the build, parameter values can be viewed in a separate page
  - tasks for parameterized builds are persisted in the queue over restarts
  - queue persistence is now in XML (with backwards compatibility for text format)
........
  r10332 | huybrechts | 2008-06-23 05:32:45 -0700 (Mon, 23 Jun 2008) | 1 line
  
  made EmbedderLoggerImpl public for use in plugins
........
  r10334 | huybrechts | 2008-06-23 05:48:10 -0700 (Mon, 23 Jun 2008) | 1 line
  
  [HUDSON-1914] additional parameter types (job, run), bugfixes
........
  r10335 | huybrechts | 2008-06-23 05:49:10 -0700 (Mon, 23 Jun 2008) | 1 line
  
  [HUDSON-1573] initialize servlet filters
........
  r10336 | huybrechts | 2008-06-23 05:52:14 -0700 (Mon, 23 Jun 2008) | 1 line
  
  [HUDSON-1915] onStarted onevent
........
  r10337 | huybrechts | 2008-06-23 06:07:32 -0700 (Mon, 23 Jun 2008) | 4 lines
  
  [HUDSON-1504] basic ui for job-based access control
  
  This allows assigning permissions per user and per job.
  It is still possible to provide defaults using a global matrix.
........
  r10338 | huybrechts | 2008-06-23 06:18:13 -0700 (Mon, 23 Jun 2008) | 3 lines
  
  [HUDSON-1504] basic ui for job-based access control
  
  adding it to the list...
........
  r10340 | huybrechts | 2008-06-23 07:23:12 -0700 (Mon, 23 Jun 2008) | 1 line
  
  [HUDSON-1504] fix compile error
........
  r10416 | huybrechts | 2008-06-25 01:13:11 -0700 (Wed, 25 Jun 2008) | 1 line
  
  initial commit staging plugin: supports doing a maven release to a staging repository, serving that repository for Hudson, and uploading it on demand
........
  r10421 | huybrechts | 2008-06-25 12:32:06 -0700 (Wed, 25 Jun 2008) | 1 line
  
  [HUDSON-1954] initial commit jbpm plugin and staging workflow example
........
  r10553 | huybrechts | 2008-07-01 14:13:57 -0700 (Tue, 01 Jul 2008) | 1 line
  
  moving registration for parameter definition out of registered class
........
  r10839 | kohsuke | 2008-07-15 13:48:05 -0700 (Tue, 15 Jul 2008) | 6 lines
  
  Making a few adjustments in preparation of merging back to the trunk.
  
  - doc updates
  - added QueueTaskFilter as a plain delegation implementation to simplify ParameterizedProjectTask.
  - renamed ParameterDefinition.newInstance(...) to createValue, to avoid having two newInstance methods
    in this part of the system that does different things
........
  r10840 | kohsuke | 2008-07-15 13:51:16 -0700 (Tue, 15 Jul 2008) | 1 line
  
  Hudson's coding convention is to use WS and no TAB.
........
  r10841 | kohsuke | 2008-07-15 14:34:37 -0700 (Tue, 15 Jul 2008) | 2 lines
  
  - making ParameterValue an abstract class to allow evolution without breaking plugins in the future
  - tweaked the UI a bit so that parameterization don't get too much visibility.
........
  r10842 | kohsuke | 2008-07-15 14:49:35 -0700 (Tue, 15 Jul 2008) | 2 lines
  
  improving the UI a bit.
  Added an icon
........
  r10843 | kohsuke | 2008-07-15 15:08:28 -0700 (Tue, 15 Jul 2008) | 1 line
  
  adding help
........
  r10844 | kohsuke | 2008-07-15 15:10:42 -0700 (Tue, 15 Jul 2008) | 1 line
  
  TAB->WS
........
  r10845 | kohsuke | 2008-07-15 15:44:47 -0700 (Tue, 15 Jul 2008) | 2 lines
  
  - Use HTTP status code to notify the automated clients that the build triggering failed.
  - Overload the "/build" URL to render the parameter entry form.
........
  r10876 | kohsuke | 2008-07-18 13:52:51 -0700 (Fri, 18 Jul 2008) | 10 lines
  
  Giving more hooks to ParameterValue to affect a build
  
   - abstracting the variable substitution process so that the actual syntax for marking
     variables (e.g., %VAR% vs ${var} vs #{xyz}) and the actual resolution process are
     orthogonal.
  
   - parameter values can now contribute BuildWrapper to a build.
  
   - parameter values can now contribute environment variables to a build.
........


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10950 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-07-22 00:48:13 +00:00
1 parent 355a9da6fc
commit 1b22943230
52 files changed
+2041 -147

No files matched your search

+12 -1
View File
@@ -5,6 +5,7 @@ import hudson.model.Hudson;
import static hudson.model.Hudson.isWindows;
import hudson.util.IOException2;
import hudson.util.QuotedStringTokenizer;
import hudson.util.VariableResolver;
import hudson.Proc.LocalProc;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -99,6 +100,16 @@ public class Util {
*
*/
public static String replaceMacro(String s, Map<String,String> properties) {
return replaceMacro(s,new VariableResolver.ByMap<String>(properties));
}
/**
* Replaces the occurrence of '$key' by <tt>resolver.get('key')</tt>.
*
* <p>
* Unlike shell, undefined variables are left as-is (this behavior is the same as Ant.)
*/
public static String replaceMacro(String s, VariableResolver<String> resolver) {
int idx=0;
while(true) {
Matcher m = VARIABLE.matcher(s);
@@ -107,7 +118,7 @@ public class Util {
String key = m.group().substring(1);
if(key.charAt(0)=='{') key = key.substring(1,key.length()-1);
String value = properties.get(key);
String value = resolver.resolve(key);
if(value==null)
idx = m.start()+1; // skip this
else {