Skip to content

Commit 4b654b1

Browse files
committed
Update documentation for Gradle plugin portal
1 parent 59ceb98 commit 4b654b1

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

build.xml

+11-12
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@
164164
<contains string="${version}" substring="-SNAPSHOT"/>
165165
</condition>
166166

167+
<filterset id="artifact-props-filterset">
168+
<filter token="NAME" value="${ant.project.name}"/>
169+
<filter token="VERSION" value="${version}"/>
170+
<filter token="GROUPID" value="${groupId}"/>
171+
<filter token="ARTIFACTID" value="${artifactId}"/>
172+
<filter token="DESCRIPTION" value="${description}"/>
173+
</filterset>
174+
167175
<property name="ivy.install.version" value="2.3.0" />
168176
<property name="ivy.jar.dir" location=".ivy" />
169177
<property name="ivy.jar.file" location="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" />
@@ -280,13 +288,7 @@
280288
<mkdir dir="${maven-build-dir}"/>
281289
<copy todir="${maven-build-dir}" encoding="${build.encoding}" outputencoding="${build.encoding}">
282290
<fileset dir="src/main/maven" includes="*.template"/>
283-
<filterset>
284-
<filter token="NAME" value="${ant.project.name}"/>
285-
<filter token="VERSION" value="${version}"/>
286-
<filter token="GROUPID" value="${groupId}"/>
287-
<filter token="ARTIFACTID" value="${artifactId}"/>
288-
<filter token="DESCRIPTION" value="${description}"/>
289-
</filterset>
291+
<filterset refid="artifact-props-filterset"/>
290292
<globmapper from="*.template" to="*"/>
291293
</copy>
292294
<property name="maven.deploy.pom" location="${maven-build-dir}/pom-deploy.xml"/>
@@ -355,6 +357,7 @@
355357
<copy todir="${documentation-dir}">
356358
<fileset dir="${documentation-dir}/tmp/de/thetaphi/forbiddenapis/gradle" includes="CheckForbiddenApis*.html" />
357359
<mapper type="glob" from="CheckForbiddenApis*" to="gradleApi*"/>
360+
<filterset refid="artifact-props-filterset"/>
358361
<filterchain>
359362
<tokenfilter>
360363
<filetokenizer/>
@@ -714,11 +717,7 @@
714717
<mkdir dir="${gradle-publish-build-dir}"/>
715718
<copy todir="${gradle-publish-build-dir}" encoding="${build.encoding}" outputencoding="${build.encoding}">
716719
<fileset dir="src/tools/gradle-plugin-portal" includes="*.template"/>
717-
<filterset>
718-
<filter token="VERSION" value="${version}"/>
719-
<filter token="GROUPID" value="${groupId}"/>
720-
<filter token="ARTIFACTID" value="${artifactId}"/>
721-
</filterset>
720+
<filterset refid="artifact-props-filterset"/>
722721
<globmapper from="*.template" to="*"/>
723722
</copy>
724723
<!-- Exceute Gradle and execute task 'publishPlugins': -->

src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,23 @@
6969
* For convenience, the plugin also defines an additional task {@code forbiddenApis}
7070
* that runs checks on all source sets.
7171
* <p>
72-
* Installation can be done from your {@code build.gradle} file:
72+
* Installation can be done from your {@code build.gradle} file using the Gradle {@code plugin} DSL:
73+
* <pre>
74+
* plugins {
75+
* id 'de.thetaphi.forbiddenapis' version '@VERSION@'
76+
* }
77+
* </pre>
78+
* Alternatively, you can use the following script snippet if dynamic configuration is required (e.g., for own tasks):
7379
* <pre>
7480
* buildscript {
7581
* repositories {
7682
* mavenCentral()
7783
* }
7884
* dependencies {
79-
* classpath 'de.thetaphi:forbiddenapis:' + FORBIDDEN_APIS_VERSION
85+
* classpath '@GROUPID@:@ARTIFACTID@:@VERSION@'
8086
* }
8187
* }
8288
*
83-
* apply plugin: 'java'
8489
* apply plugin: 'de.thetaphi.forbiddenapis'
8590
* </pre>
8691
* After that you can add the following task configuration closures:

0 commit comments

Comments
 (0)