Skip to content

Commit

Permalink
Followup #278 Assert that quarkus-extension.json exists for each exte…
Browse files Browse the repository at this point in the history
…nsion
  • Loading branch information
ppalaga committed Oct 18, 2019
1 parent fb03b3b commit 03ac64f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
32 changes: 32 additions & 0 deletions build/scripts/validate-extension-metadata.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import groovy.io.FileType

final String quarkusExtensionJsonRelPath = 'runtime/src/main/resources/META-INF/quarkus-extension.json'
final List<String> missingExtensionJsonFiles = []
project.basedir.eachFile FileType.DIRECTORIES, { extensionParentDir ->
if (new File(extensionParentDir, 'runtime/pom.xml').exists()
&& !new File(extensionParentDir, quarkusExtensionJsonRelPath).exists()) {
missingExtensionJsonFiles.add(extensionParentDir.getName() + '/' + quarkusExtensionJsonRelPath)
}
}

if (!missingExtensionJsonFiles.isEmpty()) {
throw new RuntimeException("\nMissing quarkus-extension.json files:\n\n "
+ missingExtensionJsonFiles.join("\n "))
}
17 changes: 17 additions & 0 deletions extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@

<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<executions>
<execution>
<id>validate-extension-metadata</id>
<inherited>false</inherited>
<goals>
<goal>execute</goal>
</goals>
<phase>validate</phase>
<configuration>
<source>file:///${project.basedir}/../build/scripts/validate-extension-metadata.groovy</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
Expand Down

0 comments on commit 03ac64f

Please sign in to comment.