Skip to content

Commit

Permalink
LPS-77441 Run "baseline" on portal artifacts via Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithildir authored and brianchandotcom committed Jan 29, 2018
1 parent e2c7e22 commit 9a61895
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 115 deletions.
95 changes: 1 addition & 94 deletions build-common-java.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,106 +114,13 @@
<property name="-sourcepath" value="." />
</bnd>

<var name="-baseline" unset="true" />

<if>
<not>
<equals arg1="${baseline.jar.report.level}" arg2="off" />
</not>
<then>
<loadproperties srcFile="bnd.bnd">
<filterchain>
<linecontains>
<contains value="-baseline" />
</linecontains>
</filterchain>
</loadproperties>
</then>
</if>

<if>
<isset property="-baseline" />
<then>
<antelope:stringutil property="baseline.file.beginindex" string="${-baseline}">
<indexof string="=" />
</antelope:stringutil>

<math
datatype="int"
operand1="${baseline.file.beginindex}"
operand2="1"
operation="+"
result="baseline.file.beginindex"
/>

<antelope:stringutil property="baseline.file" string="${-baseline}">
<substring beginindex="${baseline.file.beginindex}" />
</antelope:stringutil>

<var name="-baseline" unset="true" />

<antelope:stringutil property="baseline.file.name.beginindex" string="${baseline.file}">
<lastindexof string="/" />
</antelope:stringutil>

<math
datatype="int"
operand1="${baseline.file.name.beginindex}"
operand2="1"
operation="+"
result="baseline.file.name.beginindex"
/>

<antelope:stringutil property="baseline.file.name.endindex" string="${baseline.file}">
<lastindexof string="-" />
</antelope:stringutil>

<antelope:stringutil property="baseline.file.name" string="${baseline.file}">
<substring beginindex="${baseline.file.name.beginindex}" endindex="${baseline.file.name.endindex}" />
</antelope:stringutil>

<math
datatype="int"
operand1="${baseline.file.name.endindex}"
operand2="1"
operation="+"
result="baseline.file.version.beginindex"
/>

<antelope:stringutil property="baseline.file.version.endindex" string="${baseline.file}">
<lastindexof string="." />
</antelope:stringutil>

<antelope:stringutil property="baseline.file.version" string="${baseline.file}">
<substring beginindex="${baseline.file.version.beginindex}" endindex="${baseline.file.version.endindex}" />
</antelope:stringutil>

<mirrors-get
dest="${baseline.file}"
src="${baseline.jar.url}/com/liferay/portal/${baseline.file.name}/${baseline.file.version}/${baseline.file.name}-${baseline.file.version}.jar"
/>
</then>
</if>

<taskdef classname="com.liferay.ant.bnd.BaselineJarTask" classpathref="lib.classpath" name="baseline-jar" />

<if>
<isset property="jar.compat.file" />
<then>
<baseline-jar
bndFile="bnd.bnd"
bndRootFile="${project.dir}/common.bnd"
newCompatJarFile="${jar.compat.file}"
newJarFile="${jar.file}.jar"
/>
<gradle-execute forcedcacheenabled="false" task="baseline" />
</then>
<else>
<baseline-jar
bndFile="bnd.bnd"
bndRootFile="${project.dir}/common.bnd"
newJarFile="${jar.file}.jar"
/>
</else>
</if>
</then>
<else>
Expand Down
6 changes: 0 additions & 6 deletions build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1113,12 +1113,6 @@ information.
value="Bundle-Version: ${artifact.version.major.minor}.${artifact.version.micro}"
/>

<replaceregexp
file="bnd.bnd"
match="\Q/.bnd/ant-baseline-cache/com.liferay.${processed.artifact.name}-\E\d+\.\d+\.\d+\.jar"
replace="/.bnd/ant-baseline-cache/com.liferay.${processed.artifact.name}-${artifact.version.major.minor}.0.jar"
/>

<exec executable="git" failonerror="true">
<arg value="add" />
<arg value="bnd.bnd" />
Expand Down
1 change: 0 additions & 1 deletion portal-impl/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,4 @@ Include-Resource:\
@../tmp/lib-pre/com.liferay.portal.impl.message.boards.compat.jar,\
@../tmp/lib-pre/com.liferay.portal.impl.trash.compat.jar
Private-Package: com.liferay.*.dependencies
-baseline: *;file=${project.dir}/.bnd/ant-baseline-cache/com.liferay.portal.impl-2.27.0.jar
-donotcopy: (log4j\.properties|logging\.properties|portal-.*\.properties|system-.*\.properties|\.touch)
3 changes: 1 addition & 2 deletions portal-kernel/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ Include-Resource:\
@../tmp/lib-pre/com.liferay.portal.kernel.memory.compat.jar,\
@../tmp/lib-pre/com.liferay.portal.kernel.message.boards.compat.jar,\
@../tmp/lib-pre/com.liferay.portal.kernel.nio.compat.jar,\
@../tmp/lib-pre/com.liferay.portal.kernel.util.compat.jar
-baseline: *;file=${project.dir}/.bnd/ant-baseline-cache/com.liferay.portal.kernel-2.61.0.jar
@../tmp/lib-pre/com.liferay.portal.kernel.util.compat.jar
3 changes: 1 addition & 2 deletions portal-test-integration/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ Include-Resource:\
@${project.dir}/../lib/portal/httpcore.jar,\
@${project.dir}/../lib/portal/httpmime.jar,\
@${project.dir}/../lib/portal/juniversalchardet.jar,\
@${project.dir}/../lib/portal/poi.jar
-baseline: *;file=${project.dir}/.bnd/ant-baseline-cache/com.liferay.portal.test.integration-4.0.0.jar
@${project.dir}/../lib/portal/poi.jar
3 changes: 1 addition & 2 deletions portal-test/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ Include-Resource:\
@${project.dir}/../lib/development/hamcrest-core.jar,\
@${project.dir}/../lib/development/junit.jar,\
@${project.dir}/../lib/development/spring-test.jar,\
@${project.dir}/../lib/portal/aspectj-rt.jar
-baseline: *;file=${project.dir}/.bnd/ant-baseline-cache/com.liferay.portal.test-4.0.0.jar
@${project.dir}/../lib/portal/aspectj-rt.jar
3 changes: 1 addition & 2 deletions util-bridges/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ Import-Package:\
com.liferay.*,\
\
*;resolution:=optional
Include-Resource: classes
-baseline: *;file=${project.dir}/.bnd/ant-baseline-cache/com.liferay.util.bridges-2.0.0.jar
Include-Resource: classes
3 changes: 1 addition & 2 deletions util-java/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Import-Package:\
*;resolution:=optional
Include-Resource:\
classes,\
@../tmp/lib-pre/com.liferay.util.java.compat.jar
-baseline: *;file=${project.dir}/.bnd/ant-baseline-cache/com.liferay.util.java-2.5.0.jar
@../tmp/lib-pre/com.liferay.util.java.compat.jar
3 changes: 1 addition & 2 deletions util-slf4j/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ Import-Package:\
com.liferay.*,\
\
*;resolution:=optional
Include-Resource: classes
-baseline: *;file=${project.dir}/.bnd/ant-baseline-cache/com.liferay.util.slf4j-2.0.0.jar
Include-Resource: classes
3 changes: 1 addition & 2 deletions util-taglib/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,4 @@ Provide-Capability:\
osgi.extender;\
osgi.extender="jsp.taglib";\
uri="http://liferay.com/tld/util";\
version:Version="${Bundle-Version}"
-baseline: *;file=${project.dir}/.bnd/ant-baseline-cache/com.liferay.util.taglib-2.10.0.jar
version:Version="${Bundle-Version}"

0 comments on commit 9a61895

Please sign in to comment.