├── HOWTO.md
├── scripts
├── mvn2server
└── mvn2eclipse
├── .travis.yml
├── src
└── main
│ ├── resources
│ ├── index.jelly
│ ├── jenkins
│ │ └── plugins
│ │ │ └── almasw
│ │ │ └── builder
│ │ │ ├── deps
│ │ │ ├── IntrootDepResId
│ │ │ │ ├── help-id.html
│ │ │ │ └── config.jelly
│ │ │ ├── IntrootDep
│ │ │ │ ├── help-jobId.html
│ │ │ │ ├── help-project.html
│ │ │ │ ├── help-isArtifact.html
│ │ │ │ ├── help-result.html
│ │ │ │ ├── help-location.html
│ │ │ │ └── config.jelly
│ │ │ ├── IntrootDepResBuild
│ │ │ │ └── config.jelly
│ │ │ ├── IntrootDepResCompleted
│ │ │ │ └── config.jelly
│ │ │ ├── IntrootDepResFailed
│ │ │ │ └── config.jelly
│ │ │ ├── IntrootDepResSuccessful
│ │ │ │ └── config.jelly
│ │ │ ├── IntrootDepResUnstable
│ │ │ │ └── config.jelly
│ │ │ └── IntrootDepResUnsuccessful
│ │ │ │ └── config.jelly
│ │ │ └── IntrootBuilder
│ │ │ ├── help-pars.html
│ │ │ ├── help-module.html
│ │ │ ├── help-acs.html
│ │ │ ├── help-ccache.html
│ │ │ ├── help-acsInstall.html
│ │ │ ├── help-ccacheInstall.html
│ │ │ ├── help-trace.html
│ │ │ ├── help-noIfr.html
│ │ │ ├── help-dry.html
│ │ │ ├── help-profile.html
│ │ │ ├── help-limit.html
│ │ │ ├── help-noStatic.html
│ │ │ ├── help-verbose.html
│ │ │ ├── help-jobs.html
│ │ │ ├── global.jelly
│ │ │ ├── help-introot.html
│ │ │ └── config.jelly
│ └── template
│ │ └── almasw-builder.template
│ └── java
│ └── jenkins
│ └── plugins
│ └── almasw
│ └── builder
│ ├── EnumStrategy.java
│ ├── deps
│ ├── EnumBuild.java
│ ├── IntrootDepResBuild.java
│ ├── IntrootDepResUnstable.java
│ ├── IntrootDepResSuccessful.java
│ ├── IntrootDepResCompleted.java
│ ├── IntrootDepResFailed.java
│ ├── IntrootDepResUnsuccessful.java
│ ├── IntrootDepResId.java
│ ├── IntrootDepRes.java
│ └── IntrootDep.java
│ ├── RuntimeConfiguration.java
│ └── IntrootBuilder.java
├── .gitignore
├── README.md
├── pom.xml
└── LICENSE.md
/HOWTO.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/scripts/mvn2server:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | mvn hpi:run -Djetty.port=8090
4 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - oraclejdk8
4 | - oraclejdk7
5 | - openjdk7
6 |
--------------------------------------------------------------------------------
/src/main/resources/index.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 | ALMA Software Module Builder
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDepResId/help-id.html:
--------------------------------------------------------------------------------
1 |
2 | A jenkins project job id.
3 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDep/help-jobId.html:
--------------------------------------------------------------------------------
1 |
2 | A jenkins project job id, e.g: 31
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-pars.html:
--------------------------------------------------------------------------------
1 |
2 | Enable and configure Make for parallel jobs.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDep/help-project.html:
--------------------------------------------------------------------------------
1 |
2 | The name of the Jenkins job on which the module depends.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-module.html:
--------------------------------------------------------------------------------
1 |
2 | Module name, this is the same module checked-out from the SCM.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDep/help-isArtifact.html:
--------------------------------------------------------------------------------
1 |
2 | The dependency to be added to the intlist is a Jenkins artifact.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-acs.html:
--------------------------------------------------------------------------------
1 |
2 | ACS version to use, the /alma root is configured in Jenkins settings (/configure).
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-ccache.html:
--------------------------------------------------------------------------------
1 |
2 | Enable CCACHE, the ccache root dir can be configured in /configure.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-acsInstall.html:
--------------------------------------------------------------------------------
1 |
2 | Where all the ACS installations resides, typically at /alma, the default path is /alma
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-ccacheInstall.html:
--------------------------------------------------------------------------------
1 |
2 | Where the CCACHE root folder is, this is the the parent directory where bin/ is contained.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-trace.html:
--------------------------------------------------------------------------------
1 |
2 | Enable full trace of the execution script, will print all the commands to stdout executed by Jenkins.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-noIfr.html:
--------------------------------------------------------------------------------
1 |
2 | If is checked, it will set the following environment variables:
3 |
4 | - MAKE_NOIFR_CHECK=on
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/EnumStrategy.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder;
2 |
3 | /**
4 | *
5 | * @author atejeda
6 | *
7 | */
8 | public enum EnumStrategy {
9 | workspace,
10 | artifact;
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-dry.html:
--------------------------------------------------------------------------------
1 |
2 | Execute a dry run. Set -n to the command line (bash). It will print to the stdout info related to the configuration and the script to execute.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-profile.html:
--------------------------------------------------------------------------------
1 |
2 | The ACS bash profile to use, by default, if the profile isn't found or specified,
3 | will use /alma/ACS-current/ACSSW/config/.acs/.bash_profile.acs
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-limit.html:
--------------------------------------------------------------------------------
1 |
2 | The limit of the parallel jobs for the makefile, if is set to -1 it will use the number
3 | of cores available in the machine less 1, if is 0 will set no limit at all.
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-noStatic.html:
--------------------------------------------------------------------------------
1 |
2 | If is checked, it will set the following environment variables:
3 |
4 | - export _NOSTATIC="yes"
5 | - export MAKE_NOSTATIC="yes"
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-verbose.html:
--------------------------------------------------------------------------------
1 |
2 | If is checked, it will set the following environment variables:
3 |
6 | This option will generate extra verbose output to the stdout and build log.
7 |
8 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDepResBuild/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # eclipse
2 | .classpath
3 | .project
4 | .settings
5 |
6 | # velocity
7 | velocity.log*
8 |
9 | # maven
10 | target/
11 | work/
12 | pom.xml.tag
13 | pom.xml.releaseBackup
14 | pom.xml.versionsBackup
15 | pom.xml.next
16 | release.properties
17 |
18 | # java
19 | *.class
20 | *.jar
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDepResCompleted/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDepResFailed/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDepResSuccessful/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDepResUnstable/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDepResUnsuccessful/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/EnumBuild.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | public enum EnumBuild {
4 | lastBuild,
5 | lastSuccessfulBuild,
6 | lastCompletedBuild,
7 | lastStableBuild,
8 | lastFailedBuild,
9 | lastUnstableBuild,
10 | lastUnsuccessfulBuild,
11 | jobId;
12 | }
13 |
--------------------------------------------------------------------------------
/scripts/mvn2eclipse:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | _eclipse_workspace=$1
4 |
5 | [[ -z $_eclipse_workspace ]] && exit 1
6 | [[ ! -d $_eclipse_workspace ]] && exit 1
7 |
8 | mvn -DdownloadSources=true -DdownloadJavadocs=true -DoutputDirectory=target/eclipse-classes -Declipse.workspace=$_eclipse_workspace eclipse:eclipse eclipse:add-maven-repo
9 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-jobs.html:
--------------------------------------------------------------------------------
1 |
2 | How many Make parallel jobs you plan to use to build the module at makefile level. If is set to -1 it will use the number
3 | of cores available in the machine less 1, the fallback behavior is to use 1 if (#cores - 1) > 1 else just 1.
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDepResId/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDep/help-result.html:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/RuntimeConfiguration.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder;
2 |
3 | /**
4 | *
5 | * @author atejeda
6 | *
7 | */
8 | public class RuntimeConfiguration {
9 | public static final String PLUGIN_NAME = "almasw-modbuilder";
10 | public static final String LOGGER_PREFIX = "[" + PLUGIN_NAME + "]";
11 | public static final String BUILD_ERRORS_REGEX[] = {".*(==> FAILED)+.*"};
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDep/help-location.html:
--------------------------------------------------------------------------------
1 |
2 | Is where the dependency introot is located relative to the WORKSPACE or the artifact directory (build result type or job id), tipically the introot is named as, if MODULE-HEAD job as a dependency, as ALMASW-MODULE-HEAD/ACSSW, where MODULE-HEAD is a job to build MODULE by using almasw-modbuilder.
3 |
4 | This field is optional, the default directory will be ALMASW-{DEPENDENCY JOB NAME}/ACSSW.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/global.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDepResBuild.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import hudson.Extension;
4 | import hudson.ExtensionPoint;
5 |
6 | import org.kohsuke.stapler.DataBoundConstructor;
7 |
8 | public class IntrootDepResBuild extends IntrootDepRes {
9 |
10 | @DataBoundConstructor
11 | public IntrootDepResBuild() { }
12 |
13 | public String getJenkinsId() {
14 | return EnumBuild.lastBuild.name();
15 | }
16 |
17 | @Extension(ordinal = 10100)
18 | public static class IntrootDepResBuildDescriptor extends IntrootDepResDescriptor {
19 |
20 | @Override
21 | public String getDisplayName() {
22 | return EnumBuild.lastBuild.name();
23 | }
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDepResUnstable.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import hudson.Extension;
4 | import hudson.ExtensionPoint;
5 |
6 | import org.kohsuke.stapler.DataBoundConstructor;
7 |
8 | public class IntrootDepResUnstable extends IntrootDepRes {
9 |
10 | @DataBoundConstructor
11 | public IntrootDepResUnstable() { }
12 |
13 | public String getJenkinsId() {
14 | return EnumBuild.lastUnstableBuild.name();
15 | }
16 |
17 | @Extension(ordinal = 10098)
18 | public static class IntrootDepResUnstableDescriptor extends IntrootDepResDescriptor {
19 |
20 | public String getDisplayName() {
21 | return EnumBuild.lastUnstableBuild.name();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDepResSuccessful.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import hudson.Extension;
4 | import hudson.ExtensionPoint;
5 |
6 | import org.kohsuke.stapler.DataBoundConstructor;
7 |
8 | public class IntrootDepResSuccessful extends IntrootDepRes {
9 |
10 | @DataBoundConstructor
11 | public IntrootDepResSuccessful() { }
12 |
13 | public String getJenkinsId() {
14 | return EnumBuild.lastSuccessfulBuild.name();
15 | }
16 |
17 | @Extension(ordinal = 10099)
18 | public static class IntrootDepResSuccessfulDescriptor extends IntrootDepResDescriptor {
19 |
20 | public String getDisplayName() {
21 | return EnumBuild.lastSuccessfulBuild.name();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDepResCompleted.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import hudson.Extension;
4 | import hudson.ExtensionPoint;
5 |
6 | import org.kohsuke.stapler.DataBoundConstructor;
7 |
8 | public class IntrootDepResCompleted extends IntrootDepRes {
9 |
10 | @DataBoundConstructor
11 | public IntrootDepResCompleted() { }
12 |
13 | public String getJenkinsId() {
14 | return EnumBuild.lastCompletedBuild.name();
15 | }
16 |
17 | @Extension(ordinal = 10098)
18 | public static class IntrootDepResCompletedDescriptor extends IntrootDepResDescriptor {
19 |
20 | @Override
21 | public String getDisplayName() {
22 | return EnumBuild.lastCompletedBuild.name();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDepResFailed.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import hudson.Extension;
4 | import hudson.ExtensionPoint;
5 |
6 | import org.kohsuke.stapler.DataBoundConstructor;
7 |
8 | public class IntrootDepResFailed extends IntrootDepRes {
9 |
10 | @DataBoundConstructor
11 | public IntrootDepResFailed() { }
12 |
13 | public String getJenkinsId() {
14 | return EnumBuild.lastFailedBuild.name();
15 | }
16 |
17 | @Extension(ordinal = 10096)
18 | public static class IntrootDepResFailedDescriptor extends IntrootDepRes.IntrootDepResDescriptor {
19 |
20 | @Override
21 | public String getDisplayName() {
22 | return EnumBuild.lastFailedBuild.toString();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDepResUnsuccessful.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import hudson.Extension;
4 | import hudson.ExtensionPoint;
5 |
6 | import org.kohsuke.stapler.DataBoundConstructor;
7 |
8 | public class IntrootDepResUnsuccessful extends IntrootDepRes {
9 |
10 | @DataBoundConstructor
11 | public IntrootDepResUnsuccessful() { }
12 |
13 | public String getJenkinsId() {
14 | return EnumBuild.lastUnsuccessfulBuild.name();
15 | }
16 |
17 | @Extension(ordinal = 10097)
18 | public static class IntrootDepResUnsuccessfulDescriptor extends IntrootDepResDescriptor {
19 |
20 | public String getDisplayName() {
21 | return EnumBuild.lastUnsuccessfulBuild.name();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/help-introot.html:
--------------------------------------------------------------------------------
1 |
2 | The introot name, is generated relative to the
WORKSPACE Jenkins environment variable.
3 |
The field accepts any environment variables, e.g:
Jenkins
4 | or injected ones.
5 |
By default the introot will be configured as: INTROOT/${BUILD_NUMBER}/${JOB_NAME} and a symlink at ${WORKSPACE} level will be created as INTROOT-${JOB_NAME} pointing to the latest successful build job introot,
6 | where $WORKSPACE, $BUILD_NUMBER and ${JOB_NAME} are Jenkins environment variables.
7 |
8 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDepResId.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import hudson.Extension;
4 | import hudson.ExtensionPoint;
5 |
6 | import org.kohsuke.stapler.DataBoundConstructor;
7 | import org.kohsuke.stapler.export.Exported;
8 |
9 | public class IntrootDepResId extends IntrootDepRes {
10 |
11 | protected final int id;
12 |
13 | @DataBoundConstructor
14 | public IntrootDepResId(int id) {
15 | this.id = id;
16 | }
17 |
18 | @Exported
19 | public int getId() {
20 | return id;
21 | }
22 |
23 | public String getJenkinsId() {
24 | return String.valueOf(this.getJenkinsId());
25 | }
26 |
27 | @Extension(ordinal = 10095)
28 | public static class IntrootDepResIdDescriptor extends IntrootDepResDescriptor {
29 |
30 | @Override
31 | public String getDisplayName() {
32 | return EnumBuild.jobId.name();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/deps/IntrootDep/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDepRes.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import java.io.Serializable;
4 |
5 | import hudson.DescriptorExtensionList;
6 | import hudson.ExtensionPoint;
7 | import hudson.model.Describable;
8 | import hudson.model.Descriptor;
9 | import jenkins.model.Jenkins;
10 |
11 | /**
12 | *
13 | * @author atejeda
14 | *
15 | */
16 | public abstract class IntrootDepRes implements Describable, ExtensionPoint, Serializable {
17 |
18 | /**
19 | *
20 | * @return
21 | */
22 | public abstract String getJenkinsId();
23 |
24 | /**
25 | *
26 | * @return
27 | */
28 | public static DescriptorExtensionList getDescriptors() {
29 | return Jenkins.getInstance().getDescriptorList(IntrootDepRes.class);
30 | }
31 |
32 | /**
33 | *
34 | */
35 | public IntrootDepResDescriptor getDescriptor() {
36 | return (IntrootDepResDescriptor)Jenkins.getInstance().getDescriptor(getClass());
37 | }
38 |
39 | /**
40 | *
41 | * @author atejeda
42 | *
43 | */
44 | public static abstract class IntrootDepResDescriptor extends Descriptor {
45 |
46 | protected IntrootDepResDescriptor() { }
47 |
48 | protected IntrootDepResDescriptor(Class extends IntrootDepRes> clazz) {
49 | super(clazz);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # almasw-modbuilder-plugin
2 |
3 | [](https://travis-ci.org/atejeda/almasw-modbuilder-plugin)
4 |
5 | An ACS/ALMASW module builder for Jenkins.
6 |
7 | More info, check the [wiki](https://github.com/atejeda/almasw-modbuilder-plugin/wiki).
8 |
9 | This plugin aims to build ALMASW modules, but can be used to build ACS software modules as well, feel free to use in any ACS based projects.
10 |
11 | The plugin support:
12 | * build an ACS based module effortless
13 | * Choose the ACS version to use
14 | * Enable [CCACHE](https://ccache.samba.org/) (within workspace)
15 | * Makefile parallel jobs
16 | * No static
17 | * No IFR check
18 | * Add other projects/jobs as dependencies located at job id, artifact or workspace level.
19 |
20 | Thanks to everyone who helped in the development of the several bash scripts, work who was the base of the development for this plugin.
21 |
22 | JDKs supported:
23 | * oraclejdk8
24 | * oraclejdk7
25 | * openjdk7
26 |
27 | ## ALMASW
28 |
29 | Basically ALMASW is a set of software modules to control the [ALMA](http://en.wikipedia.org/wiki/Atacama_Large_Millimeter_Array) telescope instruments and manage the data produced by the telescope. These modules are built on top of ACS, a LGPL software framework/infrastructure which provides common CORBA-based services such as logging, error and alarm management, configuration database and lifecycle management in a container-model fashion.
30 |
31 | * [Github ACS-community](https://github.com/ACS-Community/ACS)
32 | * [ESO ACS](http://www.eso.org/projects/alma/develop/acs/)
33 |
34 | ## Disclaimer
35 |
36 | Even though that the name is almasw, this is a personal project developed during weekends. Support and bug fixing might be slow due free time schedule.
37 |
38 | ## License
39 |
40 | All the code in this repository is licensed under [GPLv3](https://www.gnu.org/copyleft/gpl.html).
41 |
--------------------------------------------------------------------------------
/src/main/resources/jenkins/plugins/almasw/builder/IntrootBuilder/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
57 |
58 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 | org.jenkins-ci.plugins
6 | plugin
7 | 1.580.1
8 |
9 |
10 | almasw.jenkinsci.plugin
11 | almasw-modbuilder
12 | 1.0-SNAPSHOT
13 | hpi
14 | almasw-modbuilder
15 | An ALMA Software module builder
16 | https://wiki.jenkins-ci.org/display/JENKINS/almasw+modbuilder+Plugin
17 |
18 |
19 | GLPv3 License
20 | https://www.gnu.org/copyleft/gpl.html
21 |
22 |
23 |
24 |
25 | atejeda
26 | Alexis Tejeda
27 | alexis.tejeda@gmail.com
28 |
29 |
30 |
31 | scm:git:git://github.com/atejeda/almasw-modbuilder-plugin.git
32 | scm:git:git@github.com:atejeda/almasw-modbuilder-plugin.git
33 | http://github.com/atejeda/almasw-modbuilder-plugin
34 |
35 |
36 |
37 | repo.jenkins-ci.org
38 | http://repo.jenkins-ci.org/public/
39 |
40 |
41 |
42 |
43 | repo.jenkins-ci.org
44 | http://repo.jenkins-ci.org/public/
45 |
46 |
47 |
48 |
49 | org.apache.velocity
50 | velocity
51 | 1.7
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/main/resources/template/almasw-builder.template:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # this is script is generated by almasw-modbuilder
4 | # to be execute by a jenkins job#almasw-modbuilder as builder
5 |
6 | # generated variables
7 |
8 | _build_number="${BUILD_NUMBER}"
9 |
10 | _build_id="${BUILD_ID}"
11 |
12 | _build_url="${BUILD_URL}"
13 |
14 | _build_name="${JOB_NAME}"
15 |
16 | _build_tag="${JOB_NAME}-${BUILD_NUMBER}"
17 |
18 | _build_workspace="${WORKSPACE}"
19 |
20 | _acs_path="$builder.acs"
21 |
22 | _acs_profile="${_acs_path}/ACSSW/config/.acs/.bash_profile.acs"
23 |
24 | _alma_build_tag="ALMASW-${_build_tag}"
25 |
26 | _alma_acssw="${_alma_build_tag}/ACSSW"
27 |
28 | _alma_acsdata="${_alma_build_tag}/acsdata"
29 |
30 | _alma_latest="ALMASW-${_build_name}"
31 |
32 | _alma_module="$builder.getModule()"
33 |
34 | _alma_nfo="${_alma_module}_${_build_number}.nfo"
35 |
36 | # build setup
37 |
38 | mkdir -p ${_alma_build_tag}
39 |
40 | mkdir -p ${_alma_acsdata}/tmp
41 |
42 | mkdir -p ${_alma_acsdata}/config
43 |
44 | mkdir -p ${_alma_acsdata}/tomcat5/webapp
45 |
46 | export INTROOT="${_build_workspace}/${_alma_acssw}"
47 |
48 | #if( $builder.getPars() )
49 | export MAKE_PARS="$builder.getCachedMakePars()"
50 |
51 | #end
52 | #if( $builder.getVerbose() )
53 | export MAKE_VERBOSE="yes"
54 |
55 | #end
56 | #if( $builder.getNoIfr() )
57 | export MAKE_NOIFR_CHECK="on"
58 |
59 | #end
60 | #if( $builder.getNoStatic() )
61 | export MAKE_NO_STATIC="yes"
62 |
63 | export _NO_STATIC="yes"
64 |
65 | #end
66 | #if( $builder.getCcache() )
67 | export CCACHE_ROOT="$builder.getDescriptor().getCcacheInstall()"
68 |
69 | export PATH=$CCACHE_ROOT/bin:$PATH
70 |
71 | export CCACHE_DIR="${WORKSPACE}/.ccache"
72 |
73 | #end
74 | export ACSDATA="${_alma_acsdata}"
75 |
76 | export RTAI_HOME="${_acs_path}/rtai"
77 |
78 | export LINUX_HOME="${_acs_path}/rtlinux"
79 |
80 | # lifecycle
81 |
82 | #if( $builder.hasIntlist() )
83 |
84 | #foreach( $introot in $builder.getCachedIntlist() )
85 | INTLIST_$velocityCount=$introot
86 |
87 | #end
88 |
89 | export INTLIST=#foreach( $introot in $builder.getCachedIntlist() )$INTLIST_$velocityCount:#end
90 |
91 | #end
92 |
93 | # life cycle
94 |
95 | find ${_alma_module}/ -name 'build.log' | xargs rm -f || true
96 |
97 | find ${_alma_module}/ -name 'buildLinux.log' | xargs rm -f || true
98 |
99 | source ${_acs_profile}
100 |
101 | getTemplateForDirectory INTROOT ${INTROOT} > /dev/null 2>&1
102 |
103 | rm -f ${_alma_latest} && ln -f -s ${_alma_build_tag} ${_alma_latest}
104 |
105 | ln -s ${_alma_module}/build.log ${_alma_build_tag}/
106 |
107 | #if( $builder.getCcache() )
108 | ccache -s
109 |
110 | #end
111 | make build -C ${_alma_module} 2>&1
112 |
113 | rm ${_alma_build_tag}/*.log
114 |
115 | cp ${_alma_nfo} ${_alma_build_tag}/
116 |
117 | cp ${_alma_module}/*.log ${_alma_build_tag}/
118 |
119 | echo "${_alma_latest} -> $(readlink ${_alma_latest})"
120 |
121 | #eof
122 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/deps/IntrootDep.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder.deps;
2 |
3 | import java.io.File;
4 | import java.io.Serializable;
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 | import jenkins.model.Jenkins;
9 | import jenkins.plugins.almasw.builder.EnumStrategy;
10 | import jenkins.plugins.almasw.builder.deps.IntrootDepRes.IntrootDepResDescriptor;
11 | import hudson.DescriptorExtensionList;
12 | import hudson.Extension;
13 | import hudson.model.AbstractDescribableImpl;
14 | import hudson.model.AutoCompletionCandidates;
15 | import hudson.model.Descriptor;
16 | import hudson.model.Project;
17 | import hudson.util.ListBoxModel;
18 |
19 | import org.kohsuke.stapler.DataBoundConstructor;
20 | import org.kohsuke.stapler.QueryParameter;
21 | import org.kohsuke.stapler.export.Exported;
22 | import org.kohsuke.stapler.jelly.ThisTagLibrary;
23 |
24 | /**
25 | *
26 | * @author atejeda
27 | *
28 | */
29 | public class IntrootDep extends AbstractDescribableImpl implements Serializable {
30 |
31 | public final String project;
32 | public final boolean isArtifact;
33 | public final String location;
34 | public final IntrootDepRes result;
35 |
36 | /**
37 | *
38 | * @param project
39 | * @param isArtifact
40 | * @param location
41 | * @param introot
42 | * @param result
43 | */
44 | @DataBoundConstructor
45 | public IntrootDep(String project, boolean isArtifact, String location, String introot, IntrootDepRes result) {
46 |
47 | this.project = project;
48 | this.isArtifact = isArtifact;
49 | this.location = location;
50 | this.result = result;
51 | }
52 |
53 | @Exported
54 | public String getProject() {
55 | return project;
56 | }
57 |
58 | @Exported
59 | public boolean getIsArtifact() {
60 | return isArtifact;
61 | }
62 |
63 | @Exported
64 | public String getLocation() {
65 | return location;
66 | }
67 |
68 | /**
69 | *
70 | * @return
71 | */
72 | public String getIntroot() {
73 | StringBuilder introot = new StringBuilder();
74 |
75 | try {
76 | if(this.getIsArtifact()) {
77 | String id = this.getResult().getJenkinsId();
78 | introot.append(this.getProjectRootArtifact(id));
79 | } else {
80 | introot.append(this.getProjectWorkspace());
81 | }
82 | introot.append(File.separator).append(this.getACSSW());
83 | } catch (Exception e) {
84 | e.printStackTrace();
85 | }
86 |
87 | return introot.toString();
88 | }
89 |
90 | /**
91 | *
92 | * @return
93 | */
94 | public String getACSSW() {
95 | if(this.getLocation() == null || this.getLocation().isEmpty()) {
96 | return "ALMASW-" + this.getProject() + File.separator + "ACSSW";
97 | } else {
98 | return this.getLocation();
99 | }
100 | }
101 |
102 | /**
103 | *
104 | * @return
105 | */
106 | public StringBuilder getProjectWorkspace() {
107 | StringBuilder builder = new StringBuilder();
108 | builder.append(this.getProjectRoot());
109 | builder.append(File.separator);
110 | builder.append("workspace");
111 | return builder;
112 | }
113 |
114 | /**
115 | *
116 | * @param id
117 | * @return
118 | */
119 | public StringBuilder getProjectRootArtifact(int id) {
120 | return this.getProjectRootArtifact(String.valueOf(id));
121 | }
122 |
123 | /**
124 | *
125 | * @param type
126 | * @return
127 | */
128 | public StringBuilder getProjectRootArtifact(String type) {
129 | StringBuilder builder = new StringBuilder();
130 | builder.append(this.getBuildRootId(type));
131 | builder.append(File.separator);
132 | builder.append("archive");
133 | return builder;
134 | }
135 |
136 | /**
137 | *
138 | * @param id
139 | * @return
140 | */
141 | public StringBuilder getBuildRootId(int id) {
142 | return this.getBuildRootId(String.valueOf(id));
143 | }
144 |
145 | /**
146 | *
147 | * @param id
148 | * @return
149 | */
150 | public StringBuilder getBuildRootId(String id) {
151 | StringBuilder builder = new StringBuilder();
152 | builder.append(this.getProjectRootBuild());
153 | builder.append(File.separator);
154 | builder.append(id);
155 | return builder;
156 | }
157 |
158 | /**
159 | *
160 | * @return
161 | */
162 | public StringBuilder getProjectRootBuild() {
163 | StringBuilder builder = new StringBuilder();
164 | builder.append(this.getProjectRoot());
165 | builder.append(File.separator);
166 | builder.append("builds");
167 | return builder;
168 | }
169 |
170 | /**
171 | *
172 | * @return
173 | */
174 | public StringBuilder getProjectRoot() {
175 | StringBuilder builder = new StringBuilder();
176 | builder.append("$JENKINS_HOME");
177 | builder.append(File.separator);
178 | builder.append("jobs");
179 | builder.append(File.separator);
180 | builder.append(this.getProject());
181 | return builder;
182 | }
183 |
184 | /**
185 | *
186 | * @return
187 | */
188 | public IntrootDepRes getResult() {
189 | return result;
190 | }
191 |
192 | /**
193 | *
194 | * @author atejeda
195 | *
196 | */
197 | @Extension
198 | public static final class DescriptorImpl extends Descriptor {
199 |
200 | @Override
201 | public String getDisplayName() {
202 | return "";
203 | }
204 |
205 | // validations
206 |
207 | /**
208 | *
209 | * @return
210 | */
211 | public ListBoxModel doFillStrategyItems() {
212 | ListBoxModel items = new ListBoxModel();
213 | for (EnumStrategy eStrategy : EnumStrategy.values())
214 | items.add(eStrategy.name(), eStrategy.name());
215 | return items;
216 | }
217 |
218 | /**
219 | *
220 | * @param value
221 | * @return
222 | */
223 | public AutoCompletionCandidates doAutoCompleteProject(@QueryParameter String value) {
224 | AutoCompletionCandidates projects = new AutoCompletionCandidates();
225 | for (Project project : Jenkins.getInstance().getAllItems(Project.class))
226 | projects.add(project.getName());
227 | return projects;
228 | }
229 |
230 | /**
231 | *
232 | * @return
233 | */
234 | public IntrootDepRes.IntrootDepResDescriptor getDefaultResult() {
235 | return Jenkins.getInstance().getDescriptorByType(IntrootDepResBuild.IntrootDepResBuildDescriptor.class);
236 | }
237 |
238 | /**
239 | *
240 | * @return
241 | */
242 | public DescriptorExtensionList getResults() {
243 | return IntrootDepRes.getDescriptors();
244 | }
245 | }
246 | }
247 |
--------------------------------------------------------------------------------
/src/main/java/jenkins/plugins/almasw/builder/IntrootBuilder.java:
--------------------------------------------------------------------------------
1 | package jenkins.plugins.almasw.builder;
2 |
3 | import hudson.Extension;
4 | import hudson.FilePath;
5 | import hudson.Launcher;
6 | import hudson.Launcher.ProcStarter;
7 | import hudson.model.BuildListener;
8 | import hudson.model.AbstractBuild;
9 | import hudson.model.AbstractProject;
10 | import hudson.model.Project;
11 | import hudson.tasks.BuildStepDescriptor;
12 | import hudson.tasks.Builder;
13 | import hudson.util.FormValidation;
14 | import hudson.util.ListBoxModel;
15 |
16 | import java.io.BufferedReader;
17 | import java.io.File;
18 | import java.io.FileFilter;
19 | import java.io.FileInputStream;
20 | import java.io.IOException;
21 | import java.io.InputStream;
22 | import java.io.InputStreamReader;
23 | import java.io.PrintStream;
24 | import java.io.PrintWriter;
25 | import java.io.StringWriter;
26 | import java.util.ArrayList;
27 | import java.util.Date;
28 | import java.util.HashSet;
29 | import java.util.List;
30 | import java.util.Set;
31 |
32 | import javax.servlet.ServletException;
33 |
34 | import jenkins.model.Jenkins;
35 | import jenkins.plugins.almasw.builder.deps.IntrootDep;
36 | import net.sf.json.JSONObject;
37 |
38 | import org.apache.velocity.Template;
39 | import org.apache.velocity.VelocityContext;
40 | import org.apache.velocity.app.VelocityEngine;
41 | import org.apache.velocity.runtime.RuntimeConstants;
42 | import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
43 | import org.kohsuke.stapler.DataBoundConstructor;
44 | import org.kohsuke.stapler.QueryParameter;
45 | import org.kohsuke.stapler.StaplerRequest;
46 | import org.kohsuke.stapler.export.Exported;
47 |
48 | /**
49 | *
50 | * @author atejeda
51 | *
52 | */
53 | public class IntrootBuilder extends Builder {
54 |
55 | public transient final int cores;
56 |
57 | public String acs;
58 | public final String module;
59 | public final boolean verbose;
60 | public final boolean pars;
61 | public final String jobs;
62 | public final String limit;
63 | public final boolean noStatic;
64 | public final boolean noIfr;
65 | public final List dependencies;
66 | public final boolean ccache;
67 | public final String introot;
68 | public final boolean dry;
69 | public final boolean trace;
70 | public Date date;
71 |
72 | private transient ArrayList intlist;
73 | private transient String makePars;
74 |
75 | /**
76 | *
77 | * @param acs
78 | * @param module
79 | * @param verbose
80 | * @param pars
81 | * @param jobs
82 | * @param limit
83 | * @param noStatic
84 | * @param noIfr
85 | * @param dependencies
86 | * @param ccache
87 | * @param introot
88 | * @param dry
89 | * @param trace
90 | */
91 | @DataBoundConstructor
92 | public IntrootBuilder(String acs, String module, boolean verbose,
93 | boolean pars, String jobs, String limit, boolean noStatic, boolean noIfr,
94 | List dependencies, boolean ccache, String introot, boolean dry, boolean trace) {
95 |
96 | this.cores = Runtime.getRuntime().availableProcessors();
97 |
98 | this.acs = acs;
99 | this.module = module;
100 | this.verbose = verbose;
101 | this.pars = pars;
102 | this.jobs = jobs;
103 | this.limit = limit;
104 | this.noStatic = noStatic;
105 | this.noIfr = noIfr;
106 | this.dependencies = dependencies;
107 | this.ccache = ccache;
108 | this.introot = introot;
109 | this.dry = dry;
110 | this.trace = trace;
111 | }
112 |
113 | /**
114 | *
115 | * @return
116 | */
117 | public String getCachedMakePars() {
118 | if(this.makePars == null)
119 | this.makePars = this.getMakePars();
120 | return this.getMakePars();
121 | }
122 |
123 | /**
124 | *
125 | * @return
126 | */
127 | public String getMakePars() {
128 |
129 | StringBuilder makePars = new StringBuilder();
130 |
131 | if(this.getCores() > 1) {
132 |
133 | makePars.append("-j");
134 |
135 | if(this.getJobs() == null || this.getJobs().isEmpty() || Integer.valueOf(this.jobs) < 0) {
136 | makePars.append(this.getCores() - 1);
137 | } else if(Integer.valueOf(this.getJobs()) == 0){
138 | makePars.append(1);
139 | } else {
140 | makePars.append(this.getJobs());
141 | }
142 |
143 | if(this.getLimit() != null && !this.getLimit().isEmpty() && Integer.valueOf(this.getLimit()) != 0 ) {
144 | makePars.append(" -l");
145 | if(Integer.valueOf(this.limit) < 0) {
146 | makePars.append(this.cores - 1);
147 | } else {
148 | makePars.append(this.limit);
149 | }
150 | }
151 | }
152 |
153 | return makePars.toString();
154 | }
155 |
156 | /**
157 | *
158 | * @return
159 | */
160 | public ArrayList getCachedIntlist() {
161 |
162 | if(this.intlist == null)
163 | this.intlist = this.getIntlist();
164 |
165 | return this.intlist;
166 | }
167 |
168 | // api: not used due builds, nor other stuff can be not still exists
169 | // at execution time?, instead using the jenkins hardcoded path..?
170 | // for the moment,
171 | /**
172 | *
173 | * @return
174 | */
175 | public ArrayList getIntlist() {
176 |
177 | ArrayList intlist = new ArrayList();
178 |
179 | for(IntrootDep introot: this.getDependencies()) {
180 | for(Project project: Jenkins.getInstance().getProjects()) {
181 | if(introot.getProject().equalsIgnoreCase(project.getName())) {
182 | intlist.add(introot.getIntroot());
183 | break;
184 | }
185 | }
186 | }
187 |
188 | return intlist;
189 | }
190 |
191 | /**
192 | *
193 | * @param build
194 | * @param launcher
195 | * @param listener
196 | * @return
197 | * @throws IOException
198 | */
199 | public File generateScript(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException {
200 | VelocityEngine velocity = new VelocityEngine();
201 |
202 | velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
203 | velocity.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
204 | velocity.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
205 | velocity.setProperty("runtime.log.logsystem.log4j.category", "velocity");
206 | velocity.setProperty("runtime.log.logsystem.log4j.logger", "velocity");
207 | velocity.setProperty("log4j.logger.org.apache.velocity.runtime.log.SimpleLog4JLogSystem", "INFO");
208 | velocity.init();
209 |
210 | Template template = velocity.getTemplate("template/almasw-builder.template");
211 |
212 | VelocityContext context = new VelocityContext();
213 |
214 | context.put("builder", this);
215 | context.put("build", build);
216 | context.put("launcher", launcher);
217 | context.put("listener", listener);
218 |
219 | StringWriter stringWriter = new StringWriter();
220 | template.merge(context, stringWriter);
221 |
222 | String script = this.module + "_" + build.getNumber();
223 | String workspace = (String) build.getEnvVars().get("WORKSPACE");
224 |
225 | File scriptFile = new File(workspace, script);
226 | PrintWriter printWriter = new PrintWriter(scriptFile);
227 | printWriter.print(stringWriter.toString());
228 | printWriter.close();
229 | scriptFile.setExecutable(true);
230 |
231 | return scriptFile;
232 | }
233 |
234 | /**
235 | *
236 | * @param build
237 | * @param listener
238 | * @throws IOException
239 | * @throws InterruptedException
240 | */
241 | public void generateInfo(AbstractBuild build, BuildListener listener) throws IOException, InterruptedException {
242 |
243 | String nfo = this.module + "_" + build.getNumber() + ".nfo";
244 | String workspace = (String) build.getEnvVars().get("WORKSPACE");
245 |
246 | File nfoFile = new File(workspace, nfo);
247 | PrintWriter printWriter = new PrintWriter(nfoFile);
248 |
249 | this.log(listener, "/start");
250 |
251 | this.log(listener, "/id=", String.valueOf(build.getNumber()));
252 | this.log(listener, "/cores=", String.valueOf(this.getCores()));
253 | this.log(listener, "/module=", this.getModule());
254 | this.log(listener, "/acs=", this.getAcs());
255 | this.log(listener, "/noifrcheck=", String.valueOf(this.getNoIfr()));
256 | this.log(listener, "/nostatic=", String.valueOf(this.getNoStatic()));
257 | this.log(listener, "/verbose=", String.valueOf(this.getVerbose()));
258 | this.log(listener, "/dry=", String.valueOf(this.getDry()));
259 | this.log(listener, "/ccache=", String.valueOf(this.getCcache()));
260 |
261 | if(this.getPars()) {
262 | this.log(listener, "/makejobs=", String.valueOf(this.getMakePars()));
263 | }
264 |
265 | if(this.getDependencies() != null && this.getDependencies().size() > 0) {
266 | this.log(listener, "/intlist=start");
267 |
268 | for(IntrootDep introot: this.getDependencies()) {
269 | this.log(listener, "/intlist/introot=start");
270 | this.log(listener, "/intlist/introot/project=" + introot.getProject());
271 | this.log(listener, "/intlist/introot/path=", introot.getIntroot());
272 | if(introot.getIsArtifact()) {
273 | String id = introot.getResult().getJenkinsId();
274 | String artifactPath = introot.getBuildRootId(id).toString();
275 | String artifactRealPath = artifactPath.replace("$JENKINS_HOME", build.getEnvVars().get("JENKINS_HOME").toString());
276 | FilePath symlink = new FilePath(new File(artifactRealPath));
277 | this.log(listener, "/intlist/introot/artifact/source=", introot.getResult().getJenkinsId());
278 | this.log(listener, "/intlist/introot/artifact/path=", symlink.readLink(), File.separator, introot.getACSSW());
279 | } else {
280 | this.log(listener, "/intlist/introot/workspace=", introot.getACSSW());
281 | }
282 | this.log(listener, "/intlist/introot=end");
283 | }
284 | this.log(listener, "/intlist=end");
285 | }
286 |
287 | this.log(listener, "/end");
288 | printWriter.close();
289 | }
290 |
291 | /**
292 | *
293 | * @param introot
294 | */
295 | public void getCanonicalArtifact(IntrootDep introot) {
296 | StringBuilder introotPath = new StringBuilder();
297 | introotPath.append("$JENKINS_HOME");
298 | introotPath.append(File.separator);
299 | introotPath.append("jobs");
300 | introotPath.append(File.separator);
301 | introotPath.append(introot.getProject());
302 | introotPath.append(introot.getResult().getJenkinsId());
303 | }
304 |
305 | /**
306 | *
307 | * @param listener
308 | * @param words
309 | */
310 | public void log(BuildListener listener, String ... words) {
311 | StringBuilder builder = new StringBuilder(RuntimeConfiguration.LOGGER_PREFIX);
312 | for(String word: words)
313 | builder.append(word);
314 | listener.getLogger().println(builder.toString());
315 | }
316 |
317 | /**
318 | *
319 | * @param build
320 | * @return
321 | * @throws IOException
322 | */
323 | public boolean hasErrors(AbstractBuild build, BuildListener listener) throws IOException {
324 | String workspace = (String) build.getEnvVars().get("WORKSPACE");
325 | String module = new File(workspace, this.getModule()).getCanonicalPath();
326 |
327 | File buildLog = new File(module, "build.log");
328 | File buildlinuxLog = new File(module, "buildLinux.log");
329 |
330 | if(buildLog.exists()) {
331 | return this.hasErrorsLog(buildLog, listener);
332 | } else {
333 | this.log(listener, " ", "no build.log file to check");
334 | }
335 |
336 | if(buildlinuxLog.exists()) {
337 | return this.hasErrorsLog(buildlinuxLog, listener);
338 | } else {
339 | this.log(listener, " ", "no buildLinux.log file to check");
340 | }
341 |
342 | this.log(listener, " ", "lo build logs files to check, no errors found, this might be not true due ACS makefile return always 0");
343 |
344 | return false;
345 | }
346 |
347 | /**
348 | *
349 | * @param logFile
350 | * @return
351 | * @throws IOException
352 | */
353 | public boolean hasErrorsLog(File logFile, BuildListener listener) throws IOException {
354 |
355 | this.log(listener, " ", "checking ", logFile.getName(), " for errors");
356 |
357 | InputStream is = new FileInputStream(logFile);
358 | InputStreamReader sr = new InputStreamReader(is);
359 | BufferedReader br = new BufferedReader(sr);
360 |
361 | for(String line = br.readLine(); br.readLine() != null; line = br.readLine()) {
362 | for(String regex: RuntimeConfiguration.BUILD_ERRORS_REGEX) {
363 | boolean match;
364 | if(match = line.matches(regex)) {
365 | this.log(listener, " ", logFile.getName(), " error found: ", regex);
366 | br.close();
367 | return match;
368 | }
369 | }
370 | }
371 |
372 | br.close();
373 | return false;
374 | }
375 |
376 | @Override
377 | public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
378 | PrintStream logger = listener.getLogger();
379 | String workspace = (String) build.getEnvVars().get("WORKSPACE");
380 |
381 | this.generateInfo(build, listener);
382 | File script = this.generateScript(build, launcher, listener);
383 |
384 | StringBuilder command = new StringBuilder();
385 | command.append("sh ");
386 |
387 | if(this.getDry()) {
388 | command.append("-n ");
389 | }
390 |
391 | if(this.getTrace()) {
392 | command.append("-x ");
393 | }
394 |
395 | command.append(script.getName());
396 |
397 | try {
398 | ProcStarter process = launcher
399 | .launch()
400 | .envs(build.getEnvVars())
401 | .pwd(workspace)
402 | .cmdAsSingleString(command.toString())
403 | .stdout(logger)
404 | .stderr(logger);
405 | process.join();
406 | } catch (InterruptedException e) {
407 | e.printStackTrace();
408 | return false;
409 | }
410 |
411 | boolean result = !this.hasErrors(build, listener);
412 |
413 | if(!result) {
414 | this.log(listener, " build has erros, check the logs");
415 | }
416 |
417 | return this.getDry() ? this.getDry() : result;
418 | }
419 |
420 | public boolean hasIntlist() {
421 | return this.getDependencies() != null && this.getDependencies().size() > 0;
422 | }
423 |
424 | @Exported
425 | public List getDependencies() {
426 | return dependencies;
427 | }
428 |
429 | @Exported
430 | public String getModule() {
431 | return module;
432 | }
433 |
434 | @Exported
435 | public boolean getVerbose() {
436 | return verbose;
437 | }
438 |
439 | @Exported
440 | public boolean getPars() {
441 | return pars;
442 | }
443 |
444 | @Exported
445 | public int getCores() {
446 | return cores;
447 | }
448 |
449 | @Exported
450 | public String getJobs() {
451 | return jobs;
452 | }
453 |
454 | @Exported
455 | public String getLimit() {
456 | return limit;
457 | }
458 |
459 | @Exported
460 | public boolean getNoStatic() {
461 | return noStatic;
462 | }
463 |
464 | @Exported
465 | public boolean getNoIfr() {
466 | return noIfr;
467 | }
468 |
469 | @Exported
470 | public String getAcs() {
471 | return acs;
472 | }
473 |
474 | @Exported
475 | public boolean getCcache() {
476 | return ccache;
477 | }
478 |
479 | @Exported
480 | public String getIntroot() {
481 | return introot;
482 | }
483 |
484 | @Exported
485 | public boolean getDry() {
486 | return dry;
487 | }
488 |
489 | @Exported
490 | public boolean getTrace() {
491 | return trace;
492 | }
493 |
494 | @Override
495 | public IntrootBuilderDescriptor getDescriptor() {
496 | return (IntrootBuilderDescriptor) super.getDescriptor();
497 | }
498 |
499 | /**
500 | *
501 | * @author atejeda
502 | *
503 | */
504 | @Extension
505 | public static final class IntrootBuilderDescriptor extends BuildStepDescriptor {
506 |
507 | private String ccacheInstall;
508 | private String acsInstall;
509 |
510 | public IntrootBuilderDescriptor() {
511 | load();
512 | }
513 |
514 | public boolean isApplicable(Class extends AbstractProject> aClass) {
515 | return true;
516 | }
517 |
518 | public String getDisplayName() {
519 | return "ALMA Software Module Builder";
520 | }
521 |
522 | @Override
523 | public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
524 | ccacheInstall = formData.getString("ccacheInstall");
525 | acsInstall = formData.getString("acsInstall");
526 | save();
527 | return super.configure(req, formData);
528 | }
529 |
530 | /**
531 | *
532 | * @param value
533 | * @return
534 | * @throws IOException
535 | * @throws ServletException
536 | */
537 | public FormValidation doCheckName(@QueryParameter String value) throws IOException, ServletException {
538 | if (value.length() == 0)
539 | return FormValidation.error("Please set a name");
540 | if (value.length() < 4)
541 | return FormValidation.warning("Isn't the name too short?");
542 | return FormValidation.ok();
543 | }
544 |
545 | /**
546 | *
547 | * @return
548 | */
549 | public ListBoxModel doFillAcsItems() {
550 |
551 | String basePath = (this.acsInstall != null && !this.acsInstall.isEmpty()) ? this.acsInstall : "/alma";
552 | File almaInstall = new File(basePath);
553 |
554 | ListBoxModel items = new ListBoxModel();
555 | Set installations = new HashSet();
556 |
557 | items.add(basePath + File.separator + "ACS-current");
558 |
559 | try {
560 | for(File installation : almaInstall.listFiles(
561 | new FileFilter() {
562 | public boolean accept(File pathname) {
563 | return pathname.isDirectory();
564 | }
565 | })) {
566 | if(installations.add(installation.getCanonicalPath()))
567 | items.add(installation.getCanonicalPath());
568 | }
569 |
570 | } catch (IOException e) {
571 | e.printStackTrace();
572 | }
573 |
574 | installations.clear();
575 | return items;
576 | }
577 |
578 | public String getCcacheInstall() {
579 | return ccacheInstall;
580 | }
581 |
582 | public String getAcsInstall() {
583 | return acsInstall;
584 | }
585 | }
586 | }
587 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer supp GNU GENERAL PUBLIC LICENSE
261 | Version 3, 29 June 2007
262 |
263 | Copyright (C) 2007 Free Software Foundation, Inc.
264 | Everyone is permitted to copy and distribute verbatim copies
265 | of this license document, but changing it is not allowed.
266 |
267 | Preamble
268 |
269 | The GNU General Public License is a free, copyleft license for
270 | software and other kinds of works.
271 |
272 | The licenses for most software and other practical works are designed
273 | to take away your freedom to share and change the works. By contrast,
274 | the GNU General Public License is intended to guarantee your freedom to
275 | share and change all versions of a program--to make sure it remains free
276 | software for all its users. We, the Free Software Foundation, use the
277 | GNU General Public License for most of our software; it applies also to
278 | any other work released this way by its authors. You can apply it to
279 | your programs, too.
280 |
281 | When we speak of free software, we are referring to freedom, not
282 | price. Our General Public Licenses are designed to make sure that you
283 | have the freedom to distribute copies of free software (and charge for
284 | them if you wish), that you receive source code or can get it if you
285 | want it, that you can change the software or use pieces of it in new
286 | free programs, and that you know you can do these things.
287 |
288 | To protect your rights, we need to prevent others from denying you
289 | these rights or asking you to surrender the rights. Therefore, you have
290 | certain responsibilities if you distribute copies of the software, or if
291 | you modify it: responsibilities to respect the freedom of others.
292 |
293 | For example, if you distribute copies of such a program, whether
294 | gratis or for a fee, you must pass on to the recipients the same
295 | freedoms that you received. You must make sure that they, too, receive
296 | or can get the source code. And you must show them these terms so they
297 | know their rights.
298 |
299 | Developers that use the GNU GPL protect your rights with two steps:
300 | (1) assert copyright on the software, and (2) offer you this License
301 | giving you legal permission to copy, distribute and/or modify it.
302 |
303 | For the developers' and authors' protection, the GPL clearly explains
304 | that there is no warranty for this free software. For both users' and
305 | authors' sake, the GPL requires that modified versions be marked as
306 | changed, so that their problems will not be attributed erroneously to
307 | authors of previous versions.
308 |
309 | Some devices are designed to deny users access to install or run
310 | modified versions of the software inside them, although the manufacturer
311 | can do so. This is fundamentally incompatible with the aim of
312 | protecting users' freedom to change the software. The systematic
313 | pattern of such abuse occurs in the area of products for individuals to
314 | use, which is precisely where it is most unacceptable. Therefore, we
315 | have designed this version of the GPL to prohibit the practice for those
316 | products. If such problems arise substantially in other domains, we
317 | stand ready to extend this provision to those domains in future versions
318 | of the GPL, as needed to protect the freedom of users.
319 |
320 | Finally, every program is threatened constantly by software patents.
321 | States should not allow patents to restrict development and use of
322 | software on general-purpose computers, but in those that do, we wish to
323 | avoid the special danger that patents applied to a free program could
324 | make it effectively proprietary. To prevent this, the GPL assures that
325 | patents cannot be used to render the program non-free.
326 |
327 | The precise terms and conditions for copying, distribution and
328 | modification follow.
329 |
330 | TERMS AND CONDITIONS
331 |
332 | 0. Definitions.
333 |
334 | "This License" refers to version 3 of the GNU General Public License.
335 |
336 | "Copyright" also means copyright-like laws that apply to other kinds of
337 | works, such as semiconductor masks.
338 |
339 | "The Program" refers to any copyrightable work licensed under this
340 | License. Each licensee is addressed as "you". "Licensees" and
341 | "recipients" may be individuals or organizations.
342 |
343 | To "modify" a work means to copy from or adapt all or part of the work
344 | in a fashion requiring copyright permission, other than the making of an
345 | exact copy. The resulting work is called a "modified version" of the
346 | earlier work or a work "based on" the earlier work.
347 |
348 | A "covered work" means either the unmodified Program or a work based
349 | on the Program.
350 |
351 | To "propagate" a work means to do anything with it that, without
352 | permission, would make you directly or secondarily liable for
353 | infringement under applicable copyright law, except executing it on a
354 | computer or modifying a private copy. Propagation includes copying,
355 | distribution (with or without modification), making available to the
356 | public, and in some countries other activities as well.
357 |
358 | To "convey" a work means any kind of propagation that enables other
359 | parties to make or receive copies. Mere interaction with a user through
360 | a computer network, with no transfer of a copy, is not conveying.
361 |
362 | An interactive user interface displays "Appropriate Legal Notices"
363 | to the extent that it includes a convenient and prominently visible
364 | feature that (1) displays an appropriate copyright notice, and (2)
365 | tells the user that there is no warranty for the work (except to the
366 | extent that warranties are provided), that licensees may convey the
367 | work under this License, and how to view a copy of this License. If
368 | the interface presents a list of user commands or options, such as a
369 | menu, a prominent item in the list meets this criterion.
370 |
371 | 1. Source Code.
372 |
373 | The "source code" for a work means the preferred form of the work
374 | for making modifications to it. "Object code" means any non-source
375 | form of a work.
376 |
377 | A "Standard Interface" means an interface that either is an official
378 | standard defined by a recognized standards body, or, in the case of
379 | interfaces specified for a particular programming language, one that
380 | is widely used among developers working in that language.
381 |
382 | The "System Libraries" of an executable work include anything, other
383 | than the work as a whole, that (a) is included in the normal form of
384 | packaging a Major Component, but which is not part of that Major
385 | Component, and (b) serves only to enable use of the work with that
386 | Major Component, or to implement a Standard Interface for which an
387 | implementation is available to the public in source code form. A
388 | "Major Component", in this context, means a major essential component
389 | (kernel, window system, and so on) of the specific operating system
390 | (if any) on which the executable work runs, or a compiler used to
391 | produce the work, or an object code interpreter used to run it.
392 |
393 | The "Corresponding Source" for a work in object code form means all
394 | the source code needed to generate, install, and (for an executable
395 | work) run the object code and to modify the work, including scripts to
396 | control those activities. However, it does not include the work's
397 | System Libraries, or general-purpose tools or generally available free
398 | programs which are used unmodified in performing those activities but
399 | which are not part of the work. For example, Corresponding Source
400 | includes interface definition files associated with source files for
401 | the work, and the source code for shared libraries and dynamically
402 | linked subprograms that the work is specifically designed to require,
403 | such as by intimate data communication or control flow between those
404 | subprograms and other parts of the work.
405 |
406 | The Corresponding Source need not include anything that users
407 | can regenerate automatically from other parts of the Corresponding
408 | Source.
409 |
410 | The Corresponding Source for a work in source code form is that
411 | same work.
412 |
413 | 2. Basic Permissions.
414 |
415 | All rights granted under this License are granted for the term of
416 | copyright on the Program, and are irrevocable provided the stated
417 | conditions are met. This License explicitly affirms your unlimited
418 | permission to run the unmodified Program. The output from running a
419 | covered work is covered by this License only if the output, given its
420 | content, constitutes a covered work. This License acknowledges your
421 | rights of fair use or other equivalent, as provided by copyright law.
422 |
423 | You may make, run and propagate covered works that you do not
424 | convey, without conditions so long as your license otherwise remains
425 | in force. You may convey covered works to others for the sole purpose
426 | of having them make modifications exclusively for you, or provide you
427 | with facilities for running those works, provided that you comply with
428 | the terms of this License in conveying all material for which you do
429 | not control copyright. Those thus making or running the covered works
430 | for you must do so exclusively on your behalf, under your direction
431 | and control, on terms that prohibit them from making any copies of
432 | your copyrighted material outside their relationship with you.
433 |
434 | Conveying under any other circumstances is permitted solely under
435 | the conditions stated below. Sublicensing is not allowed; section 10
436 | makes it unnecessary.
437 |
438 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
439 |
440 | No covered work shall be deemed part of an effective technological
441 | measure under any applicable law fulfilling obligations under article
442 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
443 | similar laws prohibiting or restricting circumvention of such
444 | measures.
445 |
446 | When you convey a covered work, you waive any legal power to forbid
447 | circumvention of technological measures to the extent such circumvention
448 | is effected by exercising rights under this License with respect to
449 | the covered work, and you disclaim any intention to limit operation or
450 | modification of the work as a means of enforcing, against the work's
451 | users, your or third parties' legal rights to forbid circumvention of
452 | technological measures.
453 |
454 | 4. Conveying Verbatim Copies.
455 |
456 | You may convey verbatim copies of the Program's source code as you
457 | receive it, in any medium, provided that you conspicuously and
458 | appropriately publish on each copy an appropriate copyright notice;
459 | keep intact all notices stating that this License and any
460 | non-permissive terms added in accord with section 7 apply to the code;
461 | keep intact all notices of the absence of any warranty; and give all
462 | recipients a copy of this License along with the Program.
463 |
464 | You may charge any price or no price for each copy that you convey,
465 | and you may offer support or warranty protection for a fee.
466 |
467 | 5. Conveying Modified Source Versions.
468 |
469 | You may convey a work based on the Program, or the modifications to
470 | produce it from the Program, in the form of source code under the
471 | terms of section 4, provided that you also meet all of these conditions:
472 |
473 | a) The work must carry prominent notices stating that you modified
474 | it, and giving a relevant date.
475 |
476 | b) The work must carry prominent notices stating that it is
477 | released under this License and any conditions added under section
478 | 7. This requirement modifies the requirement in section 4 to
479 | "keep intact all notices".
480 |
481 | c) You must license the entire work, as a whole, under this
482 | License to anyone who comes into possession of a copy. This
483 | License will therefore apply, along with any applicable section 7
484 | additional terms, to the whole of the work, and all its parts,
485 | regardless of how they are packaged. This License gives no
486 | permission to license the work in any other way, but it does not
487 | invalidate such permission if you have separately received it.
488 |
489 | d) If the work has interactive user interfaces, each must display
490 | Appropriate Legal Notices; however, if the Program has interactive
491 | interfaces that do not display Appropriate Legal Notices, your
492 | work need not make them do so.
493 |
494 | A compilation of a covered work with other separate and independent
495 | works, which are not by their nature extensions of the covered work,
496 | and which are not combined with it such as to form a larger program,
497 | in or on a volume of a storage or distribution medium, is called an
498 | "aggregate" if the compilation and its resulting copyright are not
499 | used to limit the access or legal rights of the compilation's users
500 | beyond what the individual works permit. Inclusion of a covered work
501 | in an aggregate does not cause this License to apply to the other
502 | parts of the aggregate.
503 |
504 | 6. Conveying Non-Source Forms.
505 |
506 | You may convey a covered work in object code form under the terms
507 | of sections 4 and 5, provided that you also convey the
508 | machine-readable Corresponding Source under the terms of this License,
509 | in one of these ways:
510 |
511 | a) Convey the object code in, or embodied in, a physical product
512 | (including a physical distribution medium), accompanied by the
513 | Corresponding Source fixed on a durable physical medium
514 | customarily used for software interchange.
515 |
516 | b) Convey the object code in, or embodied in, a physical product
517 | (including a physical distribution medium), accompanied by a
518 | written offer, valid for at least three years and valid for as
519 | long as you offer spare parts or customer support for that product
520 | model, to give anyone who possesses the object code either (1) a
521 | copy of the Corresponding Source for all the software in the
522 | product that is covered by this License, on a durable physical
523 | medium customarily used for software interchange, for a price no
524 | more than your reasonable cost of physically performing this
525 | conveying of source, or (2) access to copy the
526 | Corresponding Source from a network server at no charge.
527 |
528 | c) Convey individual copies of the object code with a copy of the
529 | written offer to provide the Corresponding Source. This
530 | alternative is allowed only occasionally and noncommercially, and
531 | only if you received the object code with such an offer, in accord
532 | with subsection 6b.
533 |
534 | d) Convey the object code by offering access from a designated
535 | place (gratis or for a charge), and offer equivalent access to the
536 | Corresponding Source in the same way through the same place at no
537 | further charge. You need not require recipients to copy the
538 | Corresponding Source along with the object code. If the place to
539 | copy the object code is a network server, the Corresponding Source
540 | may be on a different server (operated by you or a third party)
541 | that supports equivalent copying facilities, provided you maintain
542 | clear directions next to the object code saying where to find the
543 | Corresponding Source. Regardless of what server hosts the
544 | Corresponding Source, you remain obligated to ensure that it is
545 | available for as long as needed to satisfy these requirements.
546 |
547 | e) Convey the object code using peer-to-peer transmission, provided
548 | you inform other peers where the object code and Corresponding
549 | Source of the work are being offered to the general public at no
550 | charge under subsection 6d.
551 |
552 | A separable portion of the object code, whose source code is excluded
553 | from the Corresponding Source as a System Library, need not be
554 | included in conveying the object code work.
555 |
556 | A "User Product" is either (1) a "consumer product", which means any
557 | tangible personal property which is normally used for personal, family,
558 | or household purposes, or (2) anything designed or sold for incorporation
559 | into a dwelling. In determining whether a product is a consumer product,
560 | doubtful cases shall be resolved in favor of coverage. For a particular
561 | product received by a particular user, "normally used" refers to a
562 | typical or common use of that class of product, regardless of the status
563 | of the particular user or of the way in which the particular user
564 | actually uses, or expects or is expected to use, the product. A product
565 | is a consumer product regardless of whether the product has substantial
566 | commercial, industrial or non-consumer uses, unless such uses represent
567 | the only significant mode of use of the product.
568 |
569 | "Installation Information" for a User Product means any methods,
570 | procedures, authorization keys, or other information required to install
571 | and execute modified versions of a covered work in that User Product from
572 | a modified version of its Corresponding Source. The information must
573 | suffice to ensure that the continued functioning of the modified object
574 | code is in no case prevented or interfered with solely because
575 | modification has been made.
576 |
577 | If you convey an object code work under this section in, or with, or
578 | specifically for use in, a User Product, and the conveying occurs as
579 | part of a transaction in which the right of possession and use of the
580 | User Product is transferred to the recipient in perpetuity or for a
581 | fixed term (regardless of how the transaction is characterized), the
582 | Corresponding Source conveyed under this section must be accompanied
583 | by the Installation Information. But this requirement does not apply
584 | if neither you nor any third party retains the ability to install
585 | modified object code on the User Product (for example, the work has
586 | been installed in ROM).
587 |
588 | The requirement to provide Installation Information does not include a
589 | requirement to continue to provide support service, warranty, or updates
590 | for a work that has been modified or installed by the recipient, or for
591 | the User Product in which it has been modified or installed. Access to a
592 | network may be denied when the modification itself materially and
593 | adversely affects the operation of the network or violates the rules and
594 | protocols for communication across the network.
595 |
596 | Corresponding Source conveyed, and Installation Information provided,
597 | in accord with this section must be in a format that is publicly
598 | documented (and with an implementation available to the public in
599 | source code form), and must require no special password or key for
600 | unpacking, reading or copying.
601 |
602 | 7. Additional Terms.
603 |
604 | "Additional permissions" are terms that supplement the terms of this
605 | License by making exceptions from one or more of its conditions.
606 | Additional permissions that are applicable to the entire Program shall
607 | be treated as though they were included in this License, to the extent
608 | that they are valid under applicable law. If additional permissions
609 | apply only to part of the Program, that part may be used separately
610 | under those permissions, but the entire Program remains governed by
611 | this License without regard to the additional permissions.
612 |
613 | When you convey a copy of a covered work, you may at your option
614 | remove any additional permissions from that copy, or from any part of
615 | it. (Additional permissions may be written to require their own
616 | removal in certain cases when you modify the work.) You may place
617 | additional permissions on material, added by you to a covered work,
618 | for which you have or can give appropriate copyright permission.
619 |
620 | Notwithstanding any other provision of this License, for material you
621 | add to a covered work, you may (if authorized by the copyright holders of
622 | that material) supplement the terms of this License with terms:
623 |
624 | a) Disclaiming warranty or limiting liability differently from the
625 | terms of sections 15 and 16 of this License; or
626 |
627 | b) Requiring preservation of specified reasonable legal notices or
628 | author attributions in that material or in the Appropriate Legal
629 | Notices displayed by works containing it; or
630 |
631 | c) Prohibiting misrepresentation of the origin of that material, or
632 | requiring that modified versions of such material be marked in
633 | reasonable ways as different from the original version; or
634 |
635 | d) Limiting the use for publicity purposes of names of licensors or
636 | authors of the material; or
637 |
638 | e) Declining to grant rights under trademark law for use of some
639 | trade names, trademarks, or service marks; or
640 |
641 | f) Requiring indemnification of licensors and authors of that
642 | material by anyone who conveys the material (or modified versions of
643 | it) with contractual assumptions of liability to the recipient, for
644 | any liability that these contractual assumptions directly impose on
645 | those licensors and authors.
646 |
647 | All other non-permissive additional terms are considered "further
648 | restrictions" within the meaning of section 10. If the Program as you
649 | received it, or any part of it, contains a notice stating that it is
650 | governed by this License along with a term that is a further
651 | restriction, you may remove that term. If a license document contains
652 | a further restriction but permits relicensing or conveying under this
653 | License, you may add to a covered work material governed by the terms
654 | of that license document, provided that the further restriction does
655 | not survive such relicensing or conveying.
656 |
657 | If you add terms to a covered work in accord with this section, you
658 | must place, in the relevant source files, a statement of the
659 | additional terms that apply to those files, or a notice indicating
660 | where to find the applicable terms.
661 |
662 | Additional terms, permissive or non-permissive, may be stated in the
663 | form of a separately written license, or stated as exceptions;
664 | the above requirements apply either way.
665 |
666 | 8. Termination.
667 |
668 | You may not propagate or modify a covered work except as expressly
669 | provided under this License. Any attempt otherwise to propagate or
670 | modify it is void, and will automatically terminate your rights under
671 | this License (including any patent licenses granted under the third
672 | paragraph of section 11).
673 |
674 | However, if you cease all violation of this License, then your
675 | license from a particular copyright holder is reinstated (a)
676 | provisionally, unless and until the copyright holder explicitly and
677 | finally terminates your license, and (b) permanently, if the copyright
678 | holder fails to notify you of the violation by some reasonable means
679 | prior to 60 days after the cessation.
680 |
681 | Moreover, your license from a particular copyright holder is
682 | reinstated permanently if the copyright holder notifies you of the
683 | violation by some reasonable means, this is the first time you have
684 | received notice of violation of this License (for any work) from that
685 | copyright holder, and you cure the violation prior to 30 days after
686 | your receipt of the notice.
687 |
688 | Termination of your rights under this section does not terminate the
689 | licenses of parties who have received copies or rights from you under
690 | this License. If your rights have been terminated and not permanently
691 | reinstated, you do not qualify to receive new licenses for the same
692 | material under section 10.
693 |
694 | 9. Acceptance Not Required for Having Copies.
695 |
696 | You are not required to accept this License in order to receive or
697 | run a copy of the Program. Ancillary propagation of a covered work
698 | occurring solely as a consequence of using peer-to-peer transmission
699 | to receive a copy likewise does not require acceptance. However,
700 | nothing other than this License grants you permission to propagate or
701 | modify any covered work. These actions infringe copyright if you do
702 | not accept this License. Therefore, by modifying or propagating a
703 | covered work, you indicate your acceptance of this License to do so.
704 |
705 | 10. Automatic Licensing of Downstream Recipients.
706 |
707 | Each time you convey a covered work, the recipient automatically
708 | receives a license from the original licensors, to run, modify and
709 | propagate that work, subject to this License. You are not responsible
710 | for enforcing compliance by third parties with this License.
711 |
712 | An "entity transaction" is a transaction transferring control of an
713 | organization, or substantially all assets of one, or subdividing an
714 | organization, or merging organizations. If propagation of a covered
715 | work results from an entity transaction, each party to that
716 | transaction who receives a copy of the work also receives whatever
717 | licenses to the work the party's predecessor in interest had or could
718 | give under the previous paragraph, plus a right to possession of the
719 | Corresponding Source of the work from the predecessor in interest, if
720 | the predecessor has it or can get it with reasonable efforts.
721 |
722 | You may not impose any further restrictions on the exercise of the
723 | rights granted or affirmed under this License. For example, you may
724 | not impose a license fee, royalty, or other charge for exercise of
725 | rights granted under this License, and you may not initiate litigation
726 | (including a cross-claim or counterclaim in a lawsuit) alleging that
727 | any patent claim is infringed by making, using, selling, offering for
728 | sale, or importing the Program or any portion of it.
729 |
730 | 11. Patents.
731 |
732 | A "contributor" is a copyright holder who authorizes use under this
733 | License of the Program or a work on which the Program is based. The
734 | work thus licensed is called the contributor's "contributor version".
735 |
736 | A contributor's "essential patent claims" are all patent claims
737 | owned or controlled by the contributor, whether already acquired or
738 | hereafter acquired, that would be infringed by some manner, permitted
739 | by this License, of making, using, or selling its contributor version,
740 | but do not include claims that would be infringed only as a
741 | consequence of further modification of the contributor version. For
742 | purposes of this definition, "control" includes the right to grant
743 | patent sublicenses in a manner consistent with the requirements of
744 | this License.
745 |
746 | Each contributor grants you a non-exclusive, worldwide, royalty-free
747 | patent license under the contributor's essential patent claims, to
748 | make, use, sell, offer for sale, import and otherwise run, modify and
749 | propagate the contents of its contributor version.
750 |
751 | In the following three paragraphs, a "patent license" is any express
752 | agreement or commitment, however denominated, not to enforce a patent
753 | (such as an express permission to practice a patent or covenant not to
754 | sue for patent infringement). To "grant" such a patent license to a
755 | party means to make such an agreement or commitment not to enforce a
756 | patent against the party.
757 |
758 | If you convey a covered work, knowingly relying on a patent license,
759 | and the Corresponding Source of the work is not available for anyone
760 | to copy, free of charge and under the terms of this License, through a
761 | publicly available network server or other readily accessible means,
762 | then you must either (1) cause the Corresponding Source to be so
763 | available, or (2) arrange to deprive yourself of the benefit of the
764 | patent license for this particular work, or (3) arrange, in a manner
765 | consistent with the requirements of this License, to extend the patent
766 | license to downstream recipients. "Knowingly relying" means you have
767 | actual knowledge that, but for the patent license, your conveying the
768 | covered work in a country, or your recipient's use of the covered work
769 | in a country, would infringe one or more identifiable patents in that
770 | country that you have reason to believe are valid.
771 |
772 | If, pursuant to or in connection with a single transaction or
773 | arrangement, you convey, or propagate by procuring conveyance of, a
774 | covered work, and grant a patent license to some of the parties
775 | receiving the covered work authorizing them to use, propagate, modify
776 | or convey a specific copy of the covered work, then the patent license
777 | you grant is automatically extended to all recipients of the covered
778 | work and works based on it.
779 |
780 | A patent license is "discriminatory" if it does not include within
781 | the scope of its coverage, prohibits the exercise of, or is
782 | conditioned on the non-exercise of one or more of the rights that are
783 | specifically granted under this License. You may not convey a covered
784 | work if you are a party to an arrangement with a third party that is
785 | in the business of distributing software, under which you make payment
786 | to the third party based on the extent of your activity of conveying
787 | the work, and under which the third party grants, to any of the
788 | parties who would receive the covered work from you, a discriminatory
789 | patent license (a) in connection with copies of the covered work
790 | conveyed by you (or copies made from those copies), or (b) primarily
791 | for and in connection with specific products or compilations that
792 | contain the covered work, unless you entered into that arrangement,
793 | or that patent license was granted, prior to 28 March 2007.
794 |
795 | Nothing in this License shall be construed as excluding or limiting
796 | any implied license or other defenses to infringement that may
797 | otherwise be available to you under applicable patent law.
798 |
799 | 12. No Surrender of Others' Freedom.
800 |
801 | If conditions are imposed on you (whether by court order, agreement or
802 | otherwise) that contradict the conditions of this License, they do not
803 | excuse you from the conditions of this License. If you cannot convey a
804 | covered work so as to satisfy simultaneously your obligations under this
805 | License and any other pertinent obligations, then as a consequence you may
806 | not convey it at all. For example, if you agree to terms that obligate you
807 | to collect a royalty for further conveying from those to whom you convey
808 | the Program, the only way you could satisfy both those terms and this
809 | License would be to refrain entirely from conveying the Program.
810 |
811 | 13. Use with the GNU Affero General Public License.
812 |
813 | Notwithstanding any other provision of this License, you have
814 | permission to link or combine any covered work with a work licensed
815 | under version 3 of the GNU Affero General Public License into a single
816 | combined work, and to convey the resulting work. The terms of this
817 | License will continue to apply to the part which is the covered work,
818 | but the special requirements of the GNU Affero General Public License,
819 | section 13, concerning interaction through a network will apply to the
820 | combination as such.
821 |
822 | 14. Revised Versions of this License.
823 |
824 | The Free Software Foundation may publish revised and/or new versions of
825 | the GNU General Public License from time to time. Such new versions will
826 | be similar in spirit to the present version, but may differ in detail to
827 | address new problems or concerns.
828 |
829 | Each version is given a distinguishing version number. If the
830 | Program specifies that a certain numbered version of the GNU General
831 | Public License "or any later version" applies to it, you have the
832 | option of following the terms and conditions either of that numbered
833 | version or of any later version published by the Free Software
834 | Foundation. If the Program does not specify a version number of the
835 | GNU General Public License, you may choose any version ever published
836 | by the Free Software Foundation.
837 |
838 | If the Program specifies that a proxy can decide which future
839 | versions of the GNU General Public License can be used, that proxy's
840 | public statement of acceptance of a version permanently authorizes you
841 | to choose that version for the Program.
842 |
843 | Later license versions may give you additional or different
844 | permissions. However, no additional obligations are imposed on any
845 | author or copyright holder as a result of your choosing to follow a
846 | later version.
847 |
848 | 15. Disclaimer of Warranty.
849 |
850 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
851 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
852 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
853 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
854 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
855 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
856 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
857 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
858 |
859 | 16. Limitation of Liability.
860 |
861 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
862 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
863 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
864 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
865 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
866 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
867 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
868 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
869 | SUCH DAMAGES.
870 |
871 | 17. Interpretation of Sections 15 and 16.
872 |
873 | If the disclaimer of warranty and limitation of liability provided
874 | above cannot be given local legal effect according to their terms,
875 | reviewing courts shall apply local law that most closely approximates
876 | an absolute waiver of all civil liability in connection with the
877 | Program, unless a warranty or assumption of liability accompanies a
878 | copy of the Program in return for a fee.
879 |
880 | END OF TERMS AND CONDITIONS
881 |
882 | How to Apply These Terms to Your New Programs
883 |
884 | If you develop a new program, and you want it to be of the greatest
885 | possible use to the public, the best way to achieve this is to make it
886 | free software which everyone can redistribute and change under these terms.
887 |
888 | To do so, attach the following notices to the program. It is safest
889 | to attach them to the start of each source file to most effectively
890 | state the exclusion of warranty; and each file should have at least
891 | the "copyright" line and a pointer to where the full notice is found.
892 |
893 |
894 | Copyright (C)
895 |
896 | This program is free software: you can redistribute it and/or modify
897 | it under the terms of the GNU General Public License as published by
898 | the Free Software Foundation, either version 3 of the License, or
899 | (at your option) any later version.
900 |
901 | This program is distributed in the hope that it will be useful,
902 | but WITHOUT ANY WARRANTY; without even the implied warranty of
903 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
904 | GNU General Public License for more details.
905 |
906 | You should have received a copy of the GNU General Public License
907 | along with this program. If not, see .
908 |
909 | Also add information on how to contact you by electronic and paper mail.
910 |
911 | If the program does terminal interaction, make it output a short
912 | notice like this when it starts in an interactive mode:
913 |
914 | Copyright (C)
915 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
916 | This is free software, and you are welcome to redistribute it
917 | under certain conditions; type `show c' for details.
918 |
919 | The hypothetical commands `show w' and `show c' should show the appropriate
920 | parts of the General Public License. Of course, your program's commands
921 | might be different; for a GUI interface, you would use an "about box".
922 |
923 | You should also get your employer (if you work as a programmer) or school,
924 | if any, to sign a "copyright disclaimer" for the program, if necessary.
925 | For more information on this, and how to apply and follow the GNU GPL, see
926 | .
927 |
928 | The GNU General Public License does not permit incorporating your program
929 | into proprietary programs. If your program is a subroutine library, you
930 | may consider it more useful to permit linking proprietary applications with
931 | the library. If this is what you want to do, use the GNU Lesser General
932 | Public License instead of this License. But first, please read
933 | .ort for that product
934 | model, to give anyone who possesses the object code either (1) a
935 | copy of the Corresponding Source for all the software in the
936 | product that is covered by this License, on a durable physical
937 | medium customarily used for software interchange, for a price no
938 | more than your reasonable cost of physically performing this
939 | conveying of source, or (2) access to copy the
940 | Corresponding Source from a network server at no charge.
941 |
942 | c) Convey individual copies of the object code with a copy of the
943 | written offer to provide the Corresponding Source. This
944 | alternative is allowed only occasionally and noncommercially, and
945 | only if you received the object code with such an offer, in accord
946 | with subsection 6b.
947 |
948 | d) Convey the object code by offering access from a designated
949 | place (gratis or for a charge), and offer equivalent access to the
950 | Corresponding Source in the same way through the same place at no
951 | further charge. You need not require recipients to copy the
952 | Corresponding Source along with the object code. If the place to
953 | copy the object code is a network server, the Corresponding Source
954 | may be on a different server (operated by you or a third party)
955 | that supports equivalent copying facilities, provided you maintain
956 | clear directions next to the object code saying where to find the
957 | Corresponding Source. Regardless of what server hosts the
958 | Corresponding Source, you remain obligated to ensure that it is
959 | available for as long as needed to satisfy these requirements.
960 |
961 | e) Convey the object code using peer-to-peer transmission, provided
962 | you inform other peers where the object code and Corresponding
963 | Source of the work are being offered to the general public at no
964 | charge under subsection 6d.
965 |
966 | A separable portion of the object code, whose source code is excluded
967 | from the Corresponding Source as a System Library, need not be
968 | included in conveying the object code work.
969 |
970 | A "User Product" is either (1) a "consumer product", which means any
971 | tangible personal property which is normally used for personal, family,
972 | or household purposes, or (2) anything designed or sold for incorporation
973 | into a dwelling. In determining whether a product is a consumer product,
974 | doubtful cases shall be resolved in favor of coverage. For a particular
975 | product received by a particular user, "normally used" refers to a
976 | typical or common use of that class of product, regardless of the status
977 | of the particular user or of the way in which the particular user
978 | actually uses, or expects or is expected to use, the product. A product
979 | is a consumer product regardless of whether the product has substantial
980 | commercial, industrial or non-consumer uses, unless such uses represent
981 | the only significant mode of use of the product.
982 |
983 | "Installation Information" for a User Product means any methods,
984 | procedures, authorization keys, or other information required to install
985 | and execute modified versions of a covered work in that User Product from
986 | a modified version of its Corresponding Source. The information must
987 | suffice to ensure that the continued functioning of the modified object
988 | code is in no case prevented or interfered with solely because
989 | modification has been made.
990 |
991 | If you convey an object code work under this section in, or with, or
992 | specifically for use in, a User Product, and the conveying occurs as
993 | part of a transaction in which the right of possession and use of the
994 | User Product is transferred to the recipient in perpetuity or for a
995 | fixed term (regardless of how the transaction is characterized), the
996 | Corresponding Source conveyed under this section must be accompanied
997 | by the Installation Information. But this requirement does not apply
998 | if neither you nor any third party retains the ability to install
999 | modified object code on the User Product (for example, the work has
1000 | been installed in ROM).
1001 |
1002 | The requirement to provide Installation Information does not include a
1003 | requirement to continue to provide support service, warranty, or updates
1004 | for a work that has been modified or installed by the recipient, or for
1005 | the User Product in which it has been modified or installed. Access to a
1006 | network may be denied when the modification itself materially and
1007 | adversely affects the operation of the network or violates the rules and
1008 | protocols for communication across the network.
1009 |
1010 | Corresponding Source conveyed, and Installation Information provided,
1011 | in accord with this section must be in a format that is publicly
1012 | documented (and with an implementation available to the public in
1013 | source code form), and must require no special password or key for
1014 | unpacking, reading or copying.
1015 |
1016 | 7. Additional Terms.
1017 |
1018 | "Additional permissions" are terms that supplement the terms of this
1019 | License by making exceptions from one or more of its conditions.
1020 | Additional permissions that are applicable to the entire Program shall
1021 | be treated as though they were included in this License, to the extent
1022 | that they are valid under applicable law. If additional permissions
1023 | apply only to part of the Program, that part may be used separately
1024 | under those permissions, but the entire Program remains governed by
1025 | this License without regard to the additional permissions.
1026 |
1027 | When you convey a copy of a covered work, you may at your option
1028 | remove any additional permissions from that copy, or from any part of
1029 | it. (Additional permissions may be written to require their own
1030 | removal in certain cases when you modify the work.) You may place
1031 | additional permissions on material, added by you to a covered work,
1032 | for which you have or can give appropriate copyright permission.
1033 |
1034 | Notwithstanding any other provision of this License, for material you
1035 | add to a covered work, you may (if authorized by the copyright holders of
1036 | that material) supplement the terms of this License with terms:
1037 |
1038 | a) Disclaiming warranty or limiting liability differently from the
1039 | terms of sections 15 and 16 of this License; or
1040 |
1041 | b) Requiring preservation of specified reasonable legal notices or
1042 | author attributions in that material or in the Appropriate Legal
1043 | Notices displayed by works containing it; or
1044 |
1045 | c) Prohibiting misrepresentation of the origin of that material, or
1046 | requiring that modified versions of such material be marked in
1047 | reasonable ways as different from the original version; or
1048 |
1049 | d) Limiting the use for publicity purposes of names of licensors or
1050 | authors of the material; or
1051 |
1052 | e) Declining to grant rights under trademark law for use of some
1053 | trade names, trademarks, or service marks; or
1054 |
1055 | f) Requiring indemnification of licensors and authors of that
1056 | material by anyone who conveys the material (or modified versions of
1057 | it) with contractual assumptions of liability to the recipient, for
1058 | any liability that these contractual assumptions directly impose on
1059 | those licensors and authors.
1060 |
1061 | All other non-permissive additional terms are considered "further
1062 | restrictions" within the meaning of section 10. If the Program as you
1063 | received it, or any part of it, contains a notice stating that it is
1064 | governed by this License along with a term that is a further
1065 | restriction, you may remove that term. If a license document contains
1066 | a further restriction but permits relicensing or conveying under this
1067 | License, you may add to a covered work material governed by the terms
1068 | of that license document, provided that the further restriction does
1069 | not survive such relicensing or conveying.
1070 |
1071 | If you add terms to a covered work in accord with this section, you
1072 | must place, in the relevant source files, a statement of the
1073 | additional terms that apply to those files, or a notice indicating
1074 | where to find the applicable terms.
1075 |
1076 | Additional terms, permissive or non-permissive, may be stated in the
1077 | form of a separately written license, or stated as exceptions;
1078 | the above requirements apply either way.
1079 |
1080 | 8. Termination.
1081 |
1082 | You may not propagate or modify a covered work except as expressly
1083 | provided under this License. Any attempt otherwise to propagate or
1084 | modify it is void, and will automatically terminate your rights under
1085 | this License (including any patent licenses granted under the third
1086 | paragraph of section 11).
1087 |
1088 | However, if you cease all violation of this License, then your
1089 | license from a particular copyright holder is reinstated (a)
1090 | provisionally, unless and until the copyright holder explicitly and
1091 | finally terminates your license, and (b) permanently, if the copyright
1092 | holder fails to notify you of the violation by some reasonable means
1093 | prior to 60 days after the cessation.
1094 |
1095 | Moreover, your license from a particular copyright holder is
1096 | reinstated permanently if the copyright holder notifies you of the
1097 | violation by some reasonable means, this is the first time you have
1098 | received notice of violation of this License (for any work) from that
1099 | copyright holder, and you cure the violation prior to 30 days after
1100 | your receipt of the notice.
1101 |
1102 | Termination of your rights under this section does not terminate the
1103 | licenses of parties who have received copies or rights from you under
1104 | this License. If your rights have been terminated and not permanently
1105 | reinstated, you do not qualify to receive new licenses for the same
1106 | material under section 10.
1107 |
1108 | 9. Acceptance Not Required for Having Copies.
1109 |
1110 | You are not required to accept this License in order to receive or
1111 | run a copy of the Program. Ancillary propagation of a covered work
1112 | occurring solely as a consequence of using peer-to-peer transmission
1113 | to receive a copy likewise does not require acceptance. However,
1114 | nothing other than this License grants you permission to propagate or
1115 | modify any covered work. These actions infringe copyright if you do
1116 | not accept this License. Therefore, by modifying or propagating a
1117 | covered work, you indicate your acceptance of this License to do so.
1118 |
1119 | 10. Automatic Licensing of Downstream Recipients.
1120 |
1121 | Each time you convey a covered work, the recipient automatically
1122 | receives a license from the original licensors, to run, modify and
1123 | propagate that work, subject to this License. You are not responsible
1124 | for enforcing compliance by third parties with this License.
1125 |
1126 | An "entity transaction" is a transaction transferring control of an
1127 | organization, or substantially all assets of one, or subdividing an
1128 | organization, or merging organizations. If propagation of a covered
1129 | work results from an entity transaction, each party to that
1130 | transaction who receives a copy of the work also receives whatever
1131 | licenses to the work the party's predecessor in interest had or could
1132 | give under the previous paragraph, plus a right to possession of the
1133 | Corresponding Source of the work from the predecessor in interest, if
1134 | the predecessor has it or can get it with reasonable efforts.
1135 |
1136 | You may not impose any further restrictions on the exercise of the
1137 | rights granted or affirmed under this License. For example, you may
1138 | not impose a license fee, royalty, or other charge for exercise of
1139 | rights granted under this License, and you may not initiate litigation
1140 | (including a cross-claim or counterclaim in a lawsuit) alleging that
1141 | any patent claim is infringed by making, using, selling, offering for
1142 | sale, or importing the Program or any portion of it.
1143 |
1144 | 11. Patents.
1145 |
1146 | A "contributor" is a copyright holder who authorizes use under this
1147 | License of the Program or a work on which the Program is based. The
1148 | work thus licensed is called the contributor's "contributor version".
1149 |
1150 | A contributor's "essential patent claims" are all patent claims
1151 | owned or controlled by the contributor, whether already acquired or
1152 | hereafter acquired, that would be infringed by some manner, permitted
1153 | by this License, of making, using, or selling its contributor version,
1154 | but do not include claims that would be infringed only as a
1155 | consequence of further modification of the contributor version. For
1156 | purposes of this definition, "control" includes the right to grant
1157 | patent sublicenses in a manner consistent with the requirements of
1158 | this License.
1159 |
1160 | Each contributor grants you a non-exclusive, worldwide, royalty-free
1161 | patent license under the contributor's essential patent claims, to
1162 | make, use, sell, offer for sale, import and otherwise run, modify and
1163 | propagate the contents of its contributor version.
1164 |
1165 | In the following three paragraphs, a "patent license" is any express
1166 | agreement or commitment, however denominated, not to enforce a patent
1167 | (such as an express permission to practice a patent or covenant not to
1168 | sue for patent infringement). To "grant" such a patent license to a
1169 | party means to make such an agreement or commitment not to enforce a
1170 | patent against the party.
1171 |
1172 | If you convey a covered work, knowingly relying on a patent license,
1173 | and the Corresponding Source of the work is not available for anyone
1174 | to copy, free of charge and under the terms of this License, through a
1175 | publicly available network server or other readily accessible means,
1176 | then you must either (1) cause the Corresponding Source to be so
1177 | available, or (2) arrange to deprive yourself of the benefit of the
1178 | patent license for this particular work, or (3) arrange, in a manner
1179 | consistent with the requirements of this License, to extend the patent
1180 | license to downstream recipients. "Knowingly relying" means you have
1181 | actual knowledge that, but for the patent license, your conveying the
1182 | covered work in a country, or your recipient's use of the covered work
1183 | in a country, would infringe one or more identifiable patents in that
1184 | country that you have reason to believe are valid.
1185 |
1186 | If, pursuant to or in connection with a single transaction or
1187 | arrangement, you convey, or propagate by procuring conveyance of, a
1188 | covered work, and grant a patent license to some of the parties
1189 | receiving the covered work authorizing them to use, propagate, modify
1190 | or convey a specific copy of the covered work, then the patent license
1191 | you grant is automatically extended to all recipients of the covered
1192 | work and works based on it.
1193 |
1194 | A patent license is "discriminatory" if it does not include within
1195 | the scope of its coverage, prohibits the exercise of, or is
1196 | conditioned on the non-exercise of one or more of the rights that are
1197 | specifically granted under this License. You may not convey a covered
1198 | work if you are a party to an arrangement with a third party that is
1199 | in the business of distributing software, under which you make payment
1200 | to the third party based on the extent of your activity of conveying
1201 | the work, and under which the third party grants, to any of the
1202 | parties who would receive the covered work from you, a discriminatory
1203 | patent license (a) in connection with copies of the covered work
1204 | conveyed by you (or copies made from those copies), or (b) primarily
1205 | for and in connection with specific products or compilations that
1206 | contain the covered work, unless you entered into that arrangement,
1207 | or that patent license was granted, prior to 28 March 2007.
1208 |
1209 | Nothing in this License shall be construed as excluding or limiting
1210 | any implied license or other defenses to infringement that may
1211 | otherwise be available to you under applicable patent law.
1212 |
1213 | 12. No Surrender of Others' Freedom.
1214 |
1215 | If conditions are imposed on you (whether by court order, agreement or
1216 | otherwise) that contradict the conditions of this License, they do not
1217 | excuse you from the conditions of this License. If you cannot convey a
1218 | covered work so as to satisfy simultaneously your obligations under this
1219 | License and any other pertinent obligations, then as a consequence you may
1220 | not convey it at all. For example, if you agree to terms that obligate you
1221 | to collect a royalty for further conveying from those to whom you convey
1222 | the Program, the only way you could satisfy both those terms and this
1223 | License would be to refrain entirely from conveying the Program.
1224 |
1225 | 13. Use with the GNU Affero General Public License.
1226 |
1227 | Notwithstanding any other provision of this License, you have
1228 | permission to link or combine any covered work with a work licensed
1229 | under version 3 of the GNU Affero General Public License into a single
1230 | combined work, and to convey the resulting work. The terms of this
1231 | License will continue to apply to the part which is the covered work,
1232 | but the special requirements of the GNU Affero General Public License,
1233 | section 13, concerning interaction through a network will apply to the
1234 | combination as such.
1235 |
1236 | 14. Revised Versions of this License.
1237 |
1238 | The Free Software Foundation may publish revised and/or new versions of
1239 | the GNU General Public License from time to time. Such new versions will
1240 | be similar in spirit to the present version, but may differ in detail to
1241 | address new problems or concerns.
1242 |
1243 | Each version is given a distinguishing version number. If the
1244 | Program specifies that a certain numbered version of the GNU General
1245 | Public License "or any later version" applies to it, you have the
1246 | option of following the terms and conditions either of that numbered
1247 | version or of any later version published by the Free Software
1248 | Foundation. If the Program does not specify a version number of the
1249 | GNU General Public License, you may choose any version ever published
1250 | by the Free Software Foundation.
1251 |
1252 | If the Program specifies that a proxy can decide which future
1253 | versions of the GNU General Public License can be used, that proxy's
1254 | public statement of acceptance of a version permanently authorizes you
1255 | to choose that version for the Program.
1256 |
1257 | Later license versions may give you additional or different
1258 | permissions. However, no additional obligations are imposed on any
1259 | author or copyright holder as a result of your choosing to follow a
1260 | later version.
1261 |
1262 | 15. Disclaimer of Warranty.
1263 |
1264 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
1265 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
1266 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
1267 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
1268 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1269 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
1270 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
1271 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
1272 |
1273 | 16. Limitation of Liability.
1274 |
1275 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
1276 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
1277 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
1278 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
1279 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
1280 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
1281 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
1282 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
1283 | SUCH DAMAGES.
1284 |
1285 | 17. Interpretation of Sections 15 and 16.
1286 |
1287 | If the disclaimer of warranty and limitation of liability provided
1288 | above cannot be given local legal effect according to their terms,
1289 | reviewing courts shall apply local law that most closely approximates
1290 | an absolute waiver of all civil liability in connection with the
1291 | Program, unless a warranty or assumption of liability accompanies a
1292 | copy of the Program in return for a fee.
1293 |
1294 | END OF TERMS AND CONDITIONS
1295 |
1296 | How to Apply These Terms to Your New Programs
1297 |
1298 | If you develop a new program, and you want it to be of the greatest
1299 | possible use to the public, the best way to achieve this is to make it
1300 | free software which everyone can redistribute and change under these terms.
1301 |
1302 | To do so, attach the following notices to the program. It is safest
1303 | to attach them to the start of each source file to most effectively
1304 | state the exclusion of warranty; and each file should have at least
1305 | the "copyright" line and a pointer to where the full notice is found.
1306 |
1307 |
1308 | Copyright (C)
1309 |
1310 | This program is free software: you can redistribute it and/or modify
1311 | it under the terms of the GNU General Public License as published by
1312 | the Free Software Foundation, either version 3 of the License, or
1313 | (at your option) any later version.
1314 |
1315 | This program is distributed in the hope that it will be useful,
1316 | but WITHOUT ANY WARRANTY; without even the implied warranty of
1317 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1318 | GNU General Public License for more details.
1319 |
1320 | You should have received a copy of the GNU General Public License
1321 | along with this program. If not, see .
1322 |
1323 | Also add information on how to contact you by electronic and paper mail.
1324 |
1325 | If the program does terminal interaction, make it output a short
1326 | notice like this when it starts in an interactive mode:
1327 |
1328 | Copyright (C)
1329 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
1330 | This is free software, and you are welcome to redistribute it
1331 | under certain conditions; type `show c' for details.
1332 |
1333 | The hypothetical commands `show w' and `show c' should show the appropriate
1334 | parts of the General Public License. Of course, your program's commands
1335 | might be different; for a GUI interface, you would use an "about box".
1336 |
1337 | You should also get your employer (if you work as a programmer) or school,
1338 | if any, to sign a "copyright disclaimer" for the program, if necessary.
1339 | For more information on this, and how to apply and follow the GNU GPL, see
1340 | .
1341 |
1342 | The GNU General Public License does not permit incorporating your program
1343 | into proprietary programs. If your program is a subroutine library, you
1344 | may consider it more useful to permit linking proprietary applications with
1345 | the library. If this is what you want to do, use the GNU Lesser General
1346 | Public License instead of this License. But first, please read
1347 | .
1348 |
--------------------------------------------------------------------------------