|
211 | 211 | </plugins>
|
212 | 212 | </pluginManagement>
|
213 | 213 | </build>
|
214 |
| - |
215 |
| - |
| 214 | + |
216 | 215 | <profiles>
|
217 | 216 | <profile>
|
218 | 217 | <id>packAndSign</id>
|
219 | 218 | <build>
|
220 | 219 | <plugins>
|
| 220 | + <plugin> |
| 221 | + <groupId>org.apache.maven.plugins</groupId> |
| 222 | + <artifactId>maven-antrun-plugin</artifactId> |
| 223 | + <dependencies> |
| 224 | + <dependency> |
| 225 | + <groupId>ant-contrib</groupId> |
| 226 | + <artifactId>ant-contrib</artifactId> |
| 227 | + <version>1.0b3</version> |
| 228 | + <exclusions> |
| 229 | + <exclusion> |
| 230 | + <groupId>ant</groupId> |
| 231 | + <artifactId>ant</artifactId> |
| 232 | + </exclusion> |
| 233 | + </exclusions> |
| 234 | + </dependency> |
| 235 | + </dependencies> |
| 236 | + <executions> |
| 237 | + <execution> |
| 238 | + <id>sign-node-files</id> |
| 239 | + <goals> |
| 240 | + <goal>run</goal> |
| 241 | + </goals> |
| 242 | + <phase>package</phase> <!-- Do this before extracting sources--> |
| 243 | + <configuration> |
| 244 | + <target> |
| 245 | + <!-- See last answer of https://stackoverflow.com/questions/4368243/maven-antrun-with-sequential-ant-contrib-fails-to-run/45958355 --> |
| 246 | + <!-- and http://ant-contrib.sourceforge.net/tasks/tasks/index.html --> |
| 247 | + <taskdef resource="net/sf/antcontrib/antlib.xml" |
| 248 | + classpathref="maven.plugin.classpath" /> |
| 249 | + <for param="jarFile"> |
| 250 | + <fileset dir="${project.basedir}/target" includes="**/*.jar" /> |
| 251 | + <sequential> |
| 252 | + <local name="jarFilename" /> |
| 253 | + <basename property="jarFilename" file="@{jarFile}" suffix=".jar" /> |
| 254 | + <local name="signingDir" /> |
| 255 | + <property name="signingDir" value="${project.build.directory}/node-signing/${jarFilename}" /> |
| 256 | + |
| 257 | + <unzip src="@{jarFile}" dest="${signingDir}"> |
| 258 | + <patternset includes="node_modules/**/*.node" /> |
| 259 | + </unzip> |
| 260 | + |
| 261 | + <for param="nodeFileAbsolute"> |
| 262 | + <fileset dir="${signingDir}" includes="node_modules/**/*.node" erroronmissingdir="false" /> |
| 263 | + <sequential> |
| 264 | + <echo level="info" message="Mac-sign @{nodeFileAbsolute}" /> |
| 265 | + <local name="nodeFile" /> |
| 266 | + <property name="nodeFile" value="@{nodeFileAbsolute}" relative="true" basedir="${signingDir}" /> |
| 267 | + <move file="@{nodeFileAbsolute}" tofile="@{nodeFileAbsolute}-tosign" /> |
| 268 | + <exec executable="curl" dir="${signingDir}" failonerror="true"> |
| 269 | + <arg value="-o" /> |
| 270 | + <arg value="${nodeFile}" /> |
| 271 | + <arg value="-F" /> |
| 272 | + <arg value="file=@${nodeFile}-tosign" /> |
| 273 | + <arg value="https://cbi.eclipse.org/macos/codesign/sign" /> |
| 274 | + </exec> |
| 275 | + <exec executable="jar" dir="${signingDir}" failonerror="true"> |
| 276 | + <arg value="--update" /> |
| 277 | + <arg value="--file=@{jarFile}" /> |
| 278 | + <arg value="${nodeFile}" /> |
| 279 | + </exec> |
| 280 | + </sequential> |
| 281 | + </for> |
| 282 | + </sequential> |
| 283 | + </for> |
| 284 | + </target> |
| 285 | + </configuration> |
| 286 | + </execution> |
| 287 | + </executions> |
| 288 | + </plugin> |
221 | 289 | <plugin>
|
222 | 290 | <groupId>org.eclipse.cbi.maven.plugins</groupId>
|
223 | 291 | <artifactId>eclipse-jarsigner-plugin</artifactId>
|
|
252 | 320 | </plugins>
|
253 | 321 | </build>
|
254 | 322 | </profile>
|
| 323 | + |
255 | 324 | <!-- Automatic profile for Mac-specific settings -->
|
256 | 325 | <profile>
|
257 | 326 | <id>macos</id>
|
|
0 commit comments