Skip to content

Commit

Permalink
LPS-148802 print-machine-info
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Apr 4, 2022
1 parent a15e83f commit cdfac9d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,28 @@ This target has been renamed to "snapshot-bundle". Please call "snapshot-bundle"
<ant antfile="build-dist.xml" inheritAll="false" target="prepare-generated-files" />
</target>

<target name="print-machine-info">
<beanshell>
<![CDATA[
import com.sun.management.OperatingSystemMXBean;
import java.lang.management.ManagementFactory;
OperatingSystemMXBean operatingSystemMXBean = (OperatingSystemMXBean)ManagementFactory.getOperatingSystemMXBean();
project.setProperty("machine.info.arch", operatingSystemMXBean.getArch());
project.setProperty("machine.info.cores", String.valueOf(operatingSystemMXBean.getAvailableProcessors()));
project.setProperty("machine.info.os", operatingSystemMXBean.getName());
project.setProperty("machine.info.ram", String.valueOf(operatingSystemMXBean.getTotalPhysicalMemorySize() / 1073741824));
]]>
</beanshell>

<echo>${machine.info.arch}</echo>
<echo>${machine.info.cores}</echo>
<echo>${machine.info.os}</echo>
<echo>${machine.info.ram}</echo>
</target>

<target name="propertiesdoc">
<property name="properties.dest.dir" value="${doc.dir}/propertiesdoc" />

Expand Down

0 comments on commit cdfac9d

Please sign in to comment.