Package init
This commit is contained in:
parent
dc974b7ed1
commit
194569d8d4
84
avoid-jarjar-bundling.patch
Normal file
84
avoid-jarjar-bundling.patch
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
--- ivy.xml.orig 2018-04-18 12:50:14.434879557 +0100
|
||||||
|
+++ ivy.xml 2018-04-18 12:50:41.064751141 +0100
|
||||||
|
@@ -18,16 +18,14 @@
|
||||||
|
<!ENTITY maven.version "2.0">
|
||||||
|
<!ENTITY gradle.version "2.3">
|
||||||
|
<!ENTITY asm.version "6.1.1">
|
||||||
|
- <!ENTITY jarjar.asm.version "5.2">
|
||||||
|
]>
|
||||||
|
<ivy-module version="2.0">
|
||||||
|
<info organisation="de.thetaphi" module="forbiddenapis"/>
|
||||||
|
- <configurations defaultconfmapping="build->*;bundle->*;test->*;buildtools->*;jarjar->*">
|
||||||
|
+ <configurations defaultconfmapping="build->*;bundle->*;test->*;buildtools->*">
|
||||||
|
<conf name="build" transitive="false" visibility="private" />
|
||||||
|
<conf name="bundle" transitive="false" visibility="private" />
|
||||||
|
<conf name="test" transitive="false" visibility="private" />
|
||||||
|
<conf name="buildtools" transitive="false" visibility="private" />
|
||||||
|
- <conf name="jarjar" transitive="false" visibility="private" />
|
||||||
|
</configurations>
|
||||||
|
<dependencies>
|
||||||
|
<!-- we compile against the minimum ANT / Maven / Gradle versions: -->
|
||||||
|
@@ -58,10 +56,6 @@
|
||||||
|
<!-- deps only needed for build tools and tasks: -->
|
||||||
|
<dependency org="org.apache.maven" name="maven-ant-tasks" rev="2.1.3" conf="buildtools"/>
|
||||||
|
<dependency org="org.apache.rat" name="apache-rat" rev="0.11" conf="buildtools"/>
|
||||||
|
- <!-- JarJar needs older ASM version until it gets updated - add separate config: -->
|
||||||
|
- <dependency org="org.ow2.asm" name="asm" rev="&jarjar.asm.version;" conf="jarjar"/>
|
||||||
|
- <dependency org="org.ow2.asm" name="asm-commons" rev="&jarjar.asm.version;" conf="jarjar"/>
|
||||||
|
- <dependency org="org.sonatype.plugins" name="jarjar-maven-plugin" rev="1.9" conf="jarjar"/>
|
||||||
|
<!-- exclude sources and javadocs in Maven/Ivy downloads: -->
|
||||||
|
<exclude org="*" ext="*" matcher="regexp" type="source|javadoc"/>
|
||||||
|
</dependencies>
|
||||||
|
--- build.xml.orig 2018-04-18 12:53:28.583943322 +0100
|
||||||
|
+++ build.xml 2018-04-18 12:59:08.082561554 +0100
|
||||||
|
@@ -183,7 +183,6 @@
|
||||||
|
<ivy:cachepath pathid="path.main-build" conf="build" log="${ivy.logging}"/>
|
||||||
|
<ivy:cachepath pathid="path.main-bundle" conf="bundle" log="${ivy.logging}"/>
|
||||||
|
<ivy:cachepath pathid="path.test" conf="test" log="${ivy.logging}"/>
|
||||||
|
- <ivy:cachepath pathid="path.jarjar" conf="jarjar" log="${ivy.logging}"/>
|
||||||
|
<path id="path.main-run">
|
||||||
|
<path refid="path.main-bundle"/>
|
||||||
|
<pathelement path="build/main"/>
|
||||||
|
@@ -212,7 +211,6 @@
|
||||||
|
|
||||||
|
<target name="-install-tasks" depends="-init" unless="installed.tasks">
|
||||||
|
<ivy:cachepath pathid="path.tasks" conf="buildtools" log="${ivy.logging}"/>
|
||||||
|
- <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="path.jarjar"/>
|
||||||
|
<taskdef uri="antlib:org.apache.maven.artifact.ant" classpathref="path.tasks"/>
|
||||||
|
<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="path.tasks"/>
|
||||||
|
<typedef uri="antlib:org.apache.rat.anttasks" classpathref="path.tasks"/>
|
||||||
|
@@ -368,31 +366,17 @@
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="jar" depends="compile,-install-tasks,maven-descriptor" description="Create the binary JAR">
|
||||||
|
- <ivy:cachefileset setid="fileset.bundle" conf="bundle" log="${ivy.logging}"/>
|
||||||
|
<mkdir dir="dist"/>
|
||||||
|
- <jarjar destfile="${jar-file}">
|
||||||
|
+ <jar destfile="${jar-file}">
|
||||||
|
<zipfileset dir="build/main"/>
|
||||||
|
- <restrict>
|
||||||
|
- <name name="**/*.class" handledirsep="true"/>
|
||||||
|
- <not>
|
||||||
|
- <name name="module-info.class" handledirsep="true"/>
|
||||||
|
- </not>
|
||||||
|
- <archives>
|
||||||
|
- <zips><fileset refid="fileset.bundle"/></zips>
|
||||||
|
- </archives>
|
||||||
|
- </restrict>
|
||||||
|
- <keep pattern="de.thetaphi.forbiddenapis.**"/>
|
||||||
|
- <rule pattern="org.objectweb.asm.**" result="de.thetaphi.forbiddenapis.asm.@1"/>
|
||||||
|
- <rule pattern="org.apache.commons.**" result="de.thetaphi.forbiddenapis.commons.@1"/>
|
||||||
|
- <rule pattern="org.codehaus.plexus.**" result="de.thetaphi.forbiddenapis.plexus.@1"/>
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Implementation-Vendor" value="${groupId}"/>
|
||||||
|
<attribute name="Implementation-Title" value="${artifactId}"/>
|
||||||
|
<attribute name="Implementation-Version" value="${version}"/>
|
||||||
|
<attribute name="Main-Class" value="${cli-classname}"/>
|
||||||
|
</manifest>
|
||||||
|
- <metainf dir="." includes="LICENSE.txt,NOTICE.txt,bundled-licenses/**"/>
|
||||||
|
- </jarjar>
|
||||||
|
+ <metainf dir="." includes="LICENSE.txt,NOTICE.txt"/>
|
||||||
|
+ </jar>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="jar-src" description="Create source distribution">
|
||||||
34
fix-gradle-maven-build.patch
Normal file
34
fix-gradle-maven-build.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
--- ivy.xml.orig 2018-04-18 14:00:02.327714780 +0100
|
||||||
|
+++ ivy.xml 2018-04-18 14:01:58.665183881 +0100
|
||||||
|
@@ -32,8 +32,13 @@
|
||||||
|
<dependency org="org.apache.ant" name="ant" rev="1.7.0" conf="build"/>
|
||||||
|
<dependency org="org.apache.maven" name="maven-plugin-api" rev="&maven.version;" conf="build"/>
|
||||||
|
<dependency org="org.apache.maven" name="maven-artifact" rev="&maven.version;" conf="build"/>
|
||||||
|
+ <dependency org="org.apache.maven" name="maven-core" rev="&maven.version;" conf="build"/>
|
||||||
|
+ <dependency org="org.apache.maven" name="maven-compat" rev="&maven.version;" conf="build"/>
|
||||||
|
<dependency org="org.apache.maven.plugin-tools" name="maven-plugin-annotations" rev="3.4" conf="build"/>
|
||||||
|
<dependency org="org.gradle" name="gradle-core" rev="&gradle.version;" conf="build"/>
|
||||||
|
+ <dependency org="org.gradle" name="gradle-core-api" rev="&gradle.version;" conf="build"/>
|
||||||
|
+ <dependency org="org.gradle" name="gradle-resources" rev="&gradle.version;" conf="build"/>
|
||||||
|
+ <dependency org="org.gradle" name="gradle-logging" rev="&gradle.version;" conf="build"/>
|
||||||
|
<dependency org="org.gradle" name="gradle-base-services" rev="&gradle.version;" conf="build"/>
|
||||||
|
<dependency org="org.gradle" name="gradle-base-services-groovy" rev="&gradle.version;" conf="build"/>
|
||||||
|
<dependency org="org.slf4j" name="slf4j-api" rev="1.7.5" conf="build"/>
|
||||||
|
--- src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java.orig 2018-04-18 13:57:53.359303320 +0100
|
||||||
|
+++ src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java 2018-04-18 13:57:59.455275501 +0100
|
||||||
|
@@ -45,7 +45,6 @@
|
||||||
|
import org.gradle.api.tasks.InputFiles;
|
||||||
|
import org.gradle.api.tasks.Optional;
|
||||||
|
import org.gradle.api.tasks.OutputDirectories;
|
||||||
|
-import org.gradle.api.tasks.ParallelizableTask;
|
||||||
|
import org.gradle.api.tasks.SkipWhenEmpty;
|
||||||
|
import org.gradle.api.tasks.TaskAction;
|
||||||
|
import org.gradle.api.tasks.VerificationTask;
|
||||||
|
@@ -103,7 +102,6 @@
|
||||||
|
*
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
-@ParallelizableTask
|
||||||
|
public class CheckForbiddenApis extends DefaultTask implements PatternFilterable,VerificationTask,Constants {
|
||||||
|
|
||||||
|
private static final String NL = System.getProperty("line.separator", "\n");
|
||||||
BIN
forbidden-apis-2.5.tar.gz
Normal file
BIN
forbidden-apis-2.5.tar.gz
Normal file
Binary file not shown.
77
forbidden-apis.spec
Normal file
77
forbidden-apis.spec
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
Name: forbidden-apis
|
||||||
|
Version: 2.5
|
||||||
|
Release: 1
|
||||||
|
Summary: Policeman's Forbidden API Checker
|
||||||
|
License: ASL 2.0
|
||||||
|
URL: https://github.com/policeman-tools/forbidden-apis
|
||||||
|
Source0: https://github.com/policeman-tools/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: avoid-jarjar-bundling.patch
|
||||||
|
Patch1: fix-gradle-maven-build.patch
|
||||||
|
BuildArch: noarch
|
||||||
|
BuildRequires: gradle-local ivy-local maven-local ant ant-antunit ant-contrib ant-junit
|
||||||
|
BuildRequires: objectweb-asm plexus-utils maven-plugin-plugin sonatype-oss-parent
|
||||||
|
|
||||||
|
%description
|
||||||
|
Allows to parse Java byte code to find invocations of method/class/field
|
||||||
|
signatures and fail build (Apache Ant, Apache Maven, or Gradle).
|
||||||
|
|
||||||
|
%package javadoc
|
||||||
|
Summary: Javadoc for %{name}
|
||||||
|
|
||||||
|
%description javadoc
|
||||||
|
This package contains API documentation for %{name}.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
%patch0
|
||||||
|
%patch1
|
||||||
|
find . -name "*.jar" -print -delete
|
||||||
|
find . -name "*.class" -print -delete
|
||||||
|
sed -i -e '/ivy:configure/d' build.xml
|
||||||
|
%pom_xpath_remove "target/artifact:pom" build.xml
|
||||||
|
%pom_xpath_remove "target/artifact:mvn" build.xml
|
||||||
|
%pom_xpath_remove "target/artifact:install" build.xml
|
||||||
|
%pom_xpath_inject "target[@name='maven-descriptor']" \
|
||||||
|
"<exec executable='xmvn'>
|
||||||
|
<arg value=\"-o\"/>
|
||||||
|
<arg value=\"-f\"/>
|
||||||
|
<arg value=\"\${maven-build-dir}/pom-build.xml\"/>
|
||||||
|
<arg value=\"plugin:helpmojo\"/>
|
||||||
|
<arg value=\"plugin:descriptor\"/>
|
||||||
|
<arg value=\"plugin:report\"/>
|
||||||
|
<arg value=\"-Dinjected.src.dir=src/main/java\"/>
|
||||||
|
<arg value=\"-Dinjected.output.dir=../../build/main\"/>
|
||||||
|
<arg value=\"-Dinjected.build.dir=\${maven-build-dir}\"/>
|
||||||
|
<arg value=\"-Dinjected.maven-plugin-plugin.version=\${maven-plugin-plugin.version}\"/>
|
||||||
|
</exec>" build.xml
|
||||||
|
sed -i -e '/maven-ant-tasks/d' ivy.xml
|
||||||
|
sed -i -e '/uri="antlib:org.apache.maven.artifact.ant/d' build.xml
|
||||||
|
sed -i -e '/apache-rat/d' ivy.xml
|
||||||
|
sed -i -e '/uri="antlib:org.apache.rat.anttasks/d' build.xml
|
||||||
|
|
||||||
|
%build
|
||||||
|
ant -Divy.mode=local jar documentation test-junit
|
||||||
|
|
||||||
|
%install
|
||||||
|
%pom_add_dep org.apache.ant:ant:1.7.0:provided build/maven/pom-deploy.xml
|
||||||
|
%pom_add_dep org.ow2.asm:asm:6.1.1 build/maven/pom-deploy.xml
|
||||||
|
%pom_add_dep org.ow2.asm:asm-commons:6.1.1 build/maven/pom-deploy.xml
|
||||||
|
%pom_add_dep org.codehaus.plexus:plexus-utils:1.1 build/maven/pom-deploy.xml
|
||||||
|
%pom_add_dep commons-cli:commons-cli:1.3.1 build/maven/pom-deploy.xml
|
||||||
|
%mvn_artifact build/maven/pom-deploy.xml dist/forbiddenapis-2.5.jar
|
||||||
|
%mvn_install -J build/docs
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
|
||||||
|
echo "%{name} ant apache-commons-cli objectweb-asm/asm objectweb-asm/asm-commons plexus/utils" > %{name}-ant
|
||||||
|
install -pm 644 %{name}-ant %{buildroot}%{_sysconfdir}/ant.d/%{name}
|
||||||
|
|
||||||
|
%files -f .mfiles
|
||||||
|
%config(noreplace) %{_sysconfdir}/ant.d/%{name}
|
||||||
|
%license LICENSE.txt NOTICE.txt
|
||||||
|
%doc README.md
|
||||||
|
|
||||||
|
%files javadoc -f .mfiles-javadoc
|
||||||
|
%license LICENSE.txt NOTICE.txt
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Thu Jul 30 2020 leiju <leiju4@huawei.com> - 2.5-1
|
||||||
|
- Package init
|
||||||
4
forbidden-apis.yaml
Normal file
4
forbidden-apis.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: policeman-tools/forbidden-apis
|
||||||
|
tag_prefix: "^"
|
||||||
|
seperator: "."
|
||||||
Loading…
x
Reference in New Issue
Block a user