protected String getJavaHomeValue( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return null; } Installation jdk = profile.getJdk(); if ( jdk == null ) { return null; } return jdk.getVarValue(); }
private String getJavaHomeValue( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return null; } Installation jdk = profile.getJdk(); if ( jdk == null ) { return null; } return jdk.getVarValue(); }
protected String getJavaHomeValue( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return null; } Installation jdk = profile.getJdk(); if ( jdk == null ) { return null; } return jdk.getVarValue(); }
protected Map<String, String> getEnvironmentVariables( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); Map<String, String> envVars = new HashMap<String, String>(); if ( profile == null ) { return envVars; } List<Installation> environmentVariables = profile.getEnvironmentVariables(); if ( environmentVariables.isEmpty() ) { return envVars; } for ( Iterator<Installation> iterator = environmentVariables.iterator(); iterator.hasNext(); ) { Installation installation = iterator.next(); envVars.put( installation.getVarName(), installation.getVarValue() ); } return envVars; }
private static void processBuildDefinitions( List buildDefinitions, Map<Integer, Schedule> schedules, Map<Integer, Profile> profiles ) { for ( Iterator i = buildDefinitions.iterator(); i.hasNext(); ) { BuildDefinition def = (BuildDefinition) i.next(); if ( def.getSchedule() != null ) { def.setSchedule( schedules.get( Integer.valueOf( def.getSchedule().getId() ) ) ); } if ( def.getProfile() != null ) { def.setProfile( profiles.get( Integer.valueOf( def.getProfile().getId() ) ) ); } } } }
protected Map<String, String> getEnvironmentVariables( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); Map<String, String> envVars = new HashMap<String, String>(); if ( profile == null ) { return envVars; } List<Installation> environmentVariables = profile.getEnvironmentVariables(); if ( environmentVariables.isEmpty() ) { return envVars; } for ( Installation installation : environmentVariables ) { envVars.put( installation.getVarName(), installation.getVarValue() ); } return envVars; }
private Map<String, String> getEnvironmentVariables( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); Map<String, String> envVars = new HashMap<String, String>(); if ( profile == null ) { return envVars; } List<Installation> environmentVariables = profile.getEnvironmentVariables(); if ( environmentVariables.isEmpty() ) { return envVars; } for ( Installation installation : environmentVariables ) { envVars.put( installation.getVarName(), installation.getVarValue() ); } return envVars; }
protected Map<String, String> getEnvironments( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return Collections.EMPTY_MAP; } Map<String, String> envVars = new HashMap<String, String>(); String javaHome = getJavaHomeValue( buildDefinition ); if ( !StringUtils.isEmpty( javaHome ) ) { envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome ); } Installation builder = profile.getBuilder(); if ( builder != null ) { envVars.put( builder.getVarName(), builder.getVarValue() ); } envVars.putAll( getEnvironmentVariables( buildDefinition ) ); return envVars; }
protected Map<String, String> getEnvironments( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return Collections.EMPTY_MAP; } Map<String, String> envVars = new HashMap<String, String>(); String javaHome = getJavaHomeValue( buildDefinition ); if ( !StringUtils.isEmpty( javaHome ) ) { envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome ); } Installation builder = profile.getBuilder(); if ( builder != null ) { envVars.put( builder.getVarName(), builder.getVarValue() ); } envVars.putAll( getEnvironmentVariables( buildDefinition ) ); return envVars; }
protected Map<String, String> getEnvironments( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return Collections.EMPTY_MAP; } Map<String, String> envVars = new HashMap<String, String>(); String javaHome = getJavaHomeValue( buildDefinition ); if ( !StringUtils.isEmpty( javaHome ) ) { envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome ); } Installation builder = profile.getBuilder(); if ( builder != null ) { envVars.put( getInstallationService().getEnvVar( InstallationService.MAVEN1_TYPE ), builder.getVarValue() ); } envVars.putAll( getEnvironmentVariables( buildDefinition ) ); return envVars; }
protected Map<String, String> getEnvironments( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return Collections.EMPTY_MAP; } Map<String, String> envVars = new HashMap<String, String>(); String javaHome = getJavaHomeValue( buildDefinition ); if ( !StringUtils.isEmpty( javaHome ) ) { envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome ); } Installation builder = profile.getBuilder(); if ( builder != null ) { envVars.put( getInstallationService().getEnvVar( InstallationService.ANT_TYPE ), builder.getVarValue() ); } envVars.putAll( getEnvironmentVariables( buildDefinition ) ); return envVars; }
@Override protected Map<String, String> getEnvironments( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return Collections.EMPTY_MAP; } Map<String, String> envVars = new HashMap<String, String>(); String javaHome = getJavaHomeValue( buildDefinition ); if ( !StringUtils.isEmpty( javaHome ) ) { envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome ); } Installation builder = profile.getBuilder(); if ( builder != null ) { envVars.put( getInstallationService().getEnvVar( InstallationService.MAVEN2_TYPE ), builder.getVarValue() ); } envVars.putAll( getEnvironmentVariables( buildDefinition ) ); return envVars; } }
protected Map<String, String> getEnvironments( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return Collections.EMPTY_MAP; } Map<String, String> envVars = new HashMap<String, String>(); String javaHome = getJavaHomeValue( buildDefinition ); if ( !StringUtils.isEmpty( javaHome ) ) { envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome ); } Installation builder = profile.getBuilder(); if ( builder != null ) { envVars.put( getInstallationService().getEnvVar( InstallationService.MAVEN1_TYPE ), builder.getVarValue() ); } envVars.putAll( getEnvironmentVariables( buildDefinition ) ); return envVars; }
protected Map<String, String> getEnvironments( BuildDefinition buildDefinition ) { Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return Collections.EMPTY_MAP; } Map<String, String> envVars = new HashMap<String, String>(); String javaHome = getJavaHomeValue( buildDefinition ); if ( !StringUtils.isEmpty( javaHome ) ) { envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome ); } Installation builder = profile.getBuilder(); if ( builder != null ) { envVars.put( getInstallationService().getEnvVar( InstallationService.ANT_TYPE ), builder.getVarValue() ); } envVars.putAll( getEnvironmentVariables( buildDefinition ) ); return envVars; }
private List<String> getJavaHomeInformations( BuildDefinition buildDefinition ) throws InstallationException { if ( buildDefinition == null ) { return continuum.getInstallationService().getDefaultJdkInformations(); } Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return continuum.getInstallationService().getDefaultJdkInformations(); } return continuum.getInstallationService().getJdkInformations( profile.getJdk() ); }
private List<String> getJavaHomeInformations( BuildDefinition buildDefinition ) throws InstallationException { if ( buildDefinition == null ) { return continuum.getInstallationService().getDefaultJdkInformations(); } Profile profile = buildDefinition.getProfile(); if ( profile == null ) { return continuum.getInstallationService().getDefaultJdkInformations(); } return continuum.getInstallationService().getJdkInformations( profile.getJdk() ); }
/** * @see org.apache.maven.continuum.builddefinition.BuildDefinitionService#cloneBuildDefinition(org.apache.maven.continuum.model.project.BuildDefinition) */ public BuildDefinition cloneBuildDefinition( BuildDefinition buildDefinition ) { BuildDefinition cloned = new BuildDefinition(); cloned.setAlwaysBuild( buildDefinition.isAlwaysBuild() ); cloned.setArguments( buildDefinition.getArguments() ); cloned.setBuildFile( buildDefinition.getBuildFile() ); cloned.setBuildFresh( buildDefinition.isBuildFresh() ); cloned.setDefaultForProject( buildDefinition.isDefaultForProject() ); cloned.setDescription( buildDefinition.getDescription() ); cloned.setGoals( buildDefinition.getGoals() ); cloned.setProfile( buildDefinition.getProfile() ); cloned.setSchedule( buildDefinition.getSchedule() ); cloned.setType( buildDefinition.getType() ); cloned.setTemplate( buildDefinition.isTemplate() ); return cloned; }
/** * @see org.apache.maven.continuum.builddefinition.BuildDefinitionService#cloneBuildDefinition(org.apache.maven.continuum.model.project.BuildDefinition) */ public BuildDefinition cloneBuildDefinition( BuildDefinition buildDefinition ) { BuildDefinition cloned = new BuildDefinition(); cloned.setAlwaysBuild( buildDefinition.isAlwaysBuild() ); cloned.setArguments( buildDefinition.getArguments() ); cloned.setBuildFile( buildDefinition.getBuildFile() ); cloned.setBuildFresh( buildDefinition.isBuildFresh() ); cloned.setDefaultForProject( buildDefinition.isDefaultForProject() ); cloned.setDescription( buildDefinition.getDescription() ); cloned.setGoals( buildDefinition.getGoals() ); cloned.setProfile( buildDefinition.getProfile() ); cloned.setSchedule( buildDefinition.getSchedule() ); cloned.setType( buildDefinition.getType() ); cloned.setTemplate( buildDefinition.isTemplate() ); cloned.setUpdatePolicy( buildDefinition.getUpdatePolicy() ); return cloned; }
public void updateBuildDefinition( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException { try { BuildDefinition storedBuildDefinition = store.getBuildDefinition( buildDefinition.getId() ); storedBuildDefinition.setBuildFresh( buildDefinition.isBuildFresh() ); storedBuildDefinition.setAlwaysBuild( buildDefinition.isAlwaysBuild() ); storedBuildDefinition.setArguments( buildDefinition.getArguments() ); storedBuildDefinition.setBuildFile( buildDefinition.getBuildFile() ); storedBuildDefinition.setDefaultForProject( buildDefinition.isDefaultForProject() ); storedBuildDefinition.setDescription( buildDefinition.getDescription() ); storedBuildDefinition.setGoals( buildDefinition.getGoals() ); storedBuildDefinition.setProfile( buildDefinition.getProfile() ); storedBuildDefinition.setSchedule( buildDefinition.getSchedule() ); storedBuildDefinition.setType( buildDefinition.getType() ); store.storeBuildDefinition( storedBuildDefinition ); } catch ( ContinuumStoreException e ) { throw new BuildDefinitionServiceException( e.getMessage(), e ); } }
public void updateBuildDefinition( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException { try { BuildDefinition storedBuildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinition.getId() ); storedBuildDefinition.setBuildFresh( buildDefinition.isBuildFresh() ); storedBuildDefinition.setAlwaysBuild( buildDefinition.isAlwaysBuild() ); storedBuildDefinition.setArguments( buildDefinition.getArguments() ); storedBuildDefinition.setBuildFile( buildDefinition.getBuildFile() ); storedBuildDefinition.setDefaultForProject( buildDefinition.isDefaultForProject() ); storedBuildDefinition.setDescription( buildDefinition.getDescription() ); storedBuildDefinition.setGoals( buildDefinition.getGoals() ); storedBuildDefinition.setProfile( buildDefinition.getProfile() ); storedBuildDefinition.setSchedule( buildDefinition.getSchedule() ); storedBuildDefinition.setType( buildDefinition.getType() ); storedBuildDefinition.setUpdatePolicy( buildDefinition.getUpdatePolicy() ); buildDefinitionDao.storeBuildDefinition( storedBuildDefinition ); } catch ( ContinuumStoreException e ) { throw new BuildDefinitionServiceException( e.getMessage(), e ); } }