Skip to content

Commit c25e626

Browse files
committed
download license files only for release and pre-release builds
1 parent 98c4c28 commit c25e626

File tree

13 files changed

+571
-475
lines changed

13 files changed

+571
-475
lines changed

.github/scripts/build-vscode-extension.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
set -e
2+
23
extension_id=$1
34
dist_type=$2
5+
46
workdir=`pwd`
57
sources=$workdir/vscode-extensions/$extension_id
68
# server_id=${extension_id#vscode-}
@@ -10,13 +12,15 @@ cd "$sources"
1012
base_version=`jq -r .version package.json`
1113
if [ "$dist_type" = release ]; then
1214
echo -e "\n\n*Version: ${base_version}-RELEASE*" >> README.md
15+
profiles=-Pgenerate-and-include-license-files
1316
else
1417
if [ "$dist_type" = pre ]; then
1518
# for pre-release build, work the timestamp into package.json patch version. No minutes in the timestamp due VSCode pre-release lack of support for semver
1619
timestamp=`date -u +%Y%m%d%H`
1720
qualified_version=`echo $base_version | sed "s/\([0-9]\{1,\}.[0-9]\{1,\}.\)[0-9]\{1,\}/\1$timestamp/"`
1821
npm version ${qualified_version}
1922
echo -e "\n\n*Version: ${base_version}-PRE-RELEASE*" >> README.md
23+
profiles=-Pgenerate-and-include-license-files
2024
else
2125
# for snapshot build, work the timestamp into package.json version qualifier
2226
timestamp=`date -u +%Y%m%d%H%M`
@@ -27,7 +31,7 @@ else
2731
fi
2832

2933
if [ -f "./scripts/preinstall.sh" ]; then
30-
./scripts/preinstall.sh
34+
./scripts/preinstall.sh $profiles
3135
fi
3236

3337
npm install
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
#!/bin/bash
22
set -e
3-
../mvnw -B -f ../pom.xml -pl bosh-language-server -am clean install
3+
4+
profiles=$1
5+
6+
../mvnw -B -f ../pom.xml -pl bosh-language-server -am clean install $profiles

headless-services/bosh-language-server/pom.xml

Lines changed: 129 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -68,121 +68,141 @@
6868
</execution>
6969
</executions>
7070
</plugin>
71+
</plugins>
72+
</build>
7173

72-
<!-- generate and package license information for included dependencies -->
73-
<plugin>
74-
<groupId>org.codehaus.mojo</groupId>
75-
<artifactId>license-maven-plugin</artifactId>
76-
<version>1.20</version>
77-
<executions>
78-
<execution>
79-
<id>download-licenses</id>
80-
<phase>process-classes</phase>
81-
<goals>
82-
<goal>download-licenses</goal>
83-
</goals>
84-
</execution>
85-
</executions>
86-
<configuration>
87-
<licenseUrlReplacements>
88-
<licenseUrlReplacement>
89-
<regexp>http://(.*)</regexp>
90-
<replacement>https://$1</replacement>
91-
</licenseUrlReplacement>
92-
</licenseUrlReplacements>
93-
<licenseContentSanitizers>
94-
<licenseContentSanitizer>
95-
<id>all-http</id>
96-
<urlRegexp>http(.*)</urlRegexp>
97-
<contentRegexp>http://(.*)</contentRegexp>
98-
<contentReplacement>https://$1</contentReplacement>
99-
</licenseContentSanitizer>
100-
</licenseContentSanitizers>
101-
</configuration>
102-
</plugin>
103-
104-
<plugin>
105-
<groupId>org.codehaus.mojo</groupId>
106-
<artifactId>xml-maven-plugin</artifactId>
107-
<executions>
108-
<execution>
109-
<phase>process-classes</phase>
110-
<goals>
111-
<goal>transform</goal>
112-
</goals>
113-
</execution>
114-
</executions>
115-
<configuration>
116-
<transformationSets>
117-
<transformationSet>
118-
<dir>${basedir}/target/generated-resources/</dir>
119-
<includes>*.xml</includes>
120-
<stylesheet>${basedir}/license-format-stylesheet.xsl</stylesheet>
121-
<outputDir>${project.build.directory}/generated-license-information</outputDir>
122-
</transformationSet>
123-
</transformationSets>
124-
</configuration>
125-
</plugin>
74+
<profiles>
75+
<profile>
76+
<id>generate-and-include-license-files</id>
77+
<build>
78+
<plugins>
12679

127-
<plugin>
128-
<groupId>org.apache.maven.plugins</groupId>
129-
<artifactId>maven-resources-plugin</artifactId>
130-
<executions>
131-
<execution>
132-
<id>copy-own-license</id>
133-
<phase>process-classes</phase>
134-
<goals>
135-
<goal>copy-resources</goal>
136-
</goals>
80+
<!-- generate and package license information for included
81+
dependencies -->
82+
<plugin>
83+
<groupId>org.codehaus.mojo</groupId>
84+
<artifactId>license-maven-plugin</artifactId>
85+
<version>1.20</version>
86+
<executions>
87+
<execution>
88+
<id>download-licenses</id>
89+
<phase>process-classes</phase>
90+
<goals>
91+
<goal>download-licenses</goal>
92+
</goals>
93+
</execution>
94+
</executions>
13795
<configuration>
138-
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
139-
<resources>
140-
<resource>
141-
<directory>${basedir}</directory>
142-
<filtering>true</filtering>
143-
<include>LICENSE</include>
144-
</resource>
145-
</resources>
96+
<licenseUrlReplacements>
97+
<licenseUrlReplacement>
98+
<regexp>http://(.*)</regexp>
99+
<replacement>https://$1</replacement>
100+
</licenseUrlReplacement>
101+
</licenseUrlReplacements>
102+
<licenseContentSanitizers>
103+
<licenseContentSanitizer>
104+
<id>all-http</id>
105+
<urlRegexp>http(.*)</urlRegexp>
106+
<contentRegexp>http://(.*)</contentRegexp>
107+
<contentReplacement>https://$1</contentReplacement>
108+
</licenseContentSanitizer>
109+
</licenseContentSanitizers>
146110
</configuration>
147-
</execution>
148-
<execution>
149-
<id>copy-license-files</id>
150-
<phase>process-classes</phase>
151-
<goals>
152-
<goal>copy-resources</goal>
153-
</goals>
154-
<configuration>
155-
<outputDirectory>${project.build.outputDirectory}/META-INF/third-party-open-source-licenses/</outputDirectory>
156-
<resources>
157-
<resource>
158-
<directory>${project.build.directory}/generated-resources/licenses</directory>
159-
<filtering>false</filtering>
160-
</resource>
161-
</resources>
162-
</configuration>
163-
</execution>
164-
</executions>
165-
</plugin>
111+
</plugin>
166112

167-
<plugin>
168-
<groupId>com.coderplus.maven.plugins</groupId>
169-
<artifactId>copy-rename-maven-plugin</artifactId>
170-
<version>1.0</version>
171-
<executions>
172-
<execution>
173-
<id>copy-and-rename-license-summary</id>
174-
<phase>process-classes</phase>
175-
<goals>
176-
<goal>copy</goal>
177-
</goals>
113+
<plugin>
114+
<groupId>org.codehaus.mojo</groupId>
115+
<artifactId>xml-maven-plugin</artifactId>
116+
<executions>
117+
<execution>
118+
<phase>process-classes</phase>
119+
<goals>
120+
<goal>transform</goal>
121+
</goals>
122+
</execution>
123+
</executions>
178124
<configuration>
179-
<sourceFile>${project.build.directory}/generated-license-information/licenses.xml</sourceFile>
180-
<destinationFile>${project.build.outputDirectory}/META-INF/third-party-open-source-licenses.txt</destinationFile>
125+
<transformationSets>
126+
<transformationSet>
127+
<dir>${basedir}/target/generated-resources/</dir>
128+
<includes>*.xml</includes>
129+
<stylesheet>
130+
${basedir}/license-format-stylesheet.xsl</stylesheet>
131+
<outputDir>
132+
${project.build.directory}/generated-license-information</outputDir>
133+
</transformationSet>
134+
</transformationSets>
181135
</configuration>
182-
</execution>
183-
</executions>
184-
</plugin>
136+
</plugin>
137+
138+
<plugin>
139+
<groupId>org.apache.maven.plugins</groupId>
140+
<artifactId>maven-resources-plugin</artifactId>
141+
<executions>
142+
<execution>
143+
<id>copy-own-license</id>
144+
<phase>process-classes</phase>
145+
<goals>
146+
<goal>copy-resources</goal>
147+
</goals>
148+
<configuration>
149+
<outputDirectory>
150+
${project.build.outputDirectory}</outputDirectory>
151+
<resources>
152+
<resource>
153+
<directory>${basedir}</directory>
154+
<filtering>true</filtering>
155+
<include>LICENSE</include>
156+
</resource>
157+
</resources>
158+
</configuration>
159+
</execution>
160+
<execution>
161+
<id>copy-license-files</id>
162+
<phase>process-classes</phase>
163+
<goals>
164+
<goal>copy-resources</goal>
165+
</goals>
166+
<configuration>
167+
<outputDirectory>
168+
${project.build.outputDirectory}/META-INF/third-party-open-source-licenses/</outputDirectory>
169+
<resources>
170+
<resource>
171+
<directory>
172+
${project.build.directory}/generated-resources/licenses</directory>
173+
<filtering>false</filtering>
174+
</resource>
175+
</resources>
176+
</configuration>
177+
</execution>
178+
</executions>
179+
</plugin>
180+
181+
<plugin>
182+
<groupId>com.coderplus.maven.plugins</groupId>
183+
<artifactId>copy-rename-maven-plugin</artifactId>
184+
<version>1.0</version>
185+
<executions>
186+
<execution>
187+
<id>copy-and-rename-license-summary</id>
188+
<phase>process-classes</phase>
189+
<goals>
190+
<goal>copy</goal>
191+
</goals>
192+
<configuration>
193+
<sourceFile>
194+
${project.build.directory}/generated-license-information/licenses.xml</sourceFile>
195+
<destinationFile>
196+
${project.build.outputDirectory}/META-INF/third-party-open-source-licenses.txt</destinationFile>
197+
</configuration>
198+
</execution>
199+
</executions>
200+
</plugin>
201+
202+
</plugins>
203+
</build>
204+
</profile>
205+
206+
</profiles>
185207

186-
</plugins>
187-
</build>
188208
</project>
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
#!/bin/bash
22
set -e
3-
../mvnw -B -f ../pom.xml -pl concourse-language-server -am clean install
3+
4+
profiles=$1
5+
6+
../mvnw -B -f ../pom.xml -pl concourse-language-server -am clean install $profiles

0 commit comments

Comments
 (0)