Skip to content

Commit

Permalink
using auto generated poms also a fix for CustomOpTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Frost committed Nov 26, 2024
1 parent 9afe3b7 commit 0101fa4
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 377 deletions.
48 changes: 18 additions & 30 deletions hat/backends/opencl/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
Expand All @@ -22,63 +21,52 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
--><project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>oracle.code</groupId>
<artifactId>hat-backend-opencl</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<!-- this required to inherit parent properties -->
<parent>
<groupId>oracle.code</groupId>
<artifactId>hat-backends</artifactId>
<version>1.0</version>
<artifactId>hat.backends</artifactId>
</parent>

<groupId>oracle.code</groupId>
<artifactId>hat-backend-opencl</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>oracle.code</groupId>
<version>1.0</version>
<artifactId>hat</artifactId>
<version>1.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
<!-- we want to inherit properties from parent but not the
plugin that calls cmake -->
</configuration>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
<!--We want to inherit properties from parent but not plugin that calls cmake-->
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy file="target/hat-backend-opencl-1.0.jar" todir="${hat.target}"/>
<copy file="target/hat-backend-opencl-1.0.jar" toDir="${hat.target}"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


</project>
154 changes: 74 additions & 80 deletions hat/backends/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
Expand All @@ -22,85 +21,80 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>oracle.code</groupId>
<version>1.0</version>
<artifactId>hat.backends</artifactId>
<packaging>pom</packaging>
<!-- this required to inherit parent properties -->
--><project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<groupId>oracle.code</groupId>
<artifactId>hat-backends</artifactId>
<version>1.0</version>
<parent>
<groupId>oracle.code</groupId>
<artifactId>hat-root</artifactId>
<version>1.0</version>
<artifactId>hat.root</artifactId>
</parent>

<modules>
<module>opencl</module>
<module>cuda</module>
<module>mock</module>
<module>ptx</module>
<!--<module>spirv</module>-->
</modules>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>cmake_compile</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<arguments>
<argument>-DHAT_TARGET=${hat.target}</argument>
<argument>-B</argument>
<argument>${hat.target}/cmake-build-debug</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>cmake_install_build</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<arguments>
<argument>--build</argument>
<argument>${hat.target}/cmake-build-debug</argument>
</arguments>
</configuration>
</execution>

<execution>
<id>cmake_clean</id>
<phase>clean</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>rm </executable>
<arguments>
<argument>-rf</argument>
<argument>cmake-build-debug</argument>
</arguments>
</configuration>
</execution>

</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>oracle.code</groupId>
<artifactId>hat</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<modules>
<module>ptx</module>
<module>opencl</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>cmake-compile</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<arguments>
<argument>-DHAT_TARGET=${hat.target}</argument>
<argument>-B</argument>
<argument>${hat.target}/cmake-build-debug</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>cmake_install_build</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cmake</executable>
<arguments>
<argument>--build</argument>
<argument>${hat.target}/cmake-build-debug</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>cmake_clean</id>
<phase>clean</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>rm</executable>
<arguments>
<argument>-rf</argument>
<argument>cmake-build-debug</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
46 changes: 18 additions & 28 deletions hat/backends/ptx/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
Expand All @@ -22,61 +21,52 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
--><project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>oracle.code</groupId>
<artifactId>hat-backend-ptx</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<!-- this required to inherit parent properties -->
<parent>
<groupId>oracle.code</groupId>
<artifactId>hat-backends</artifactId>
<version>1.0</version>
<artifactId>hat.backends</artifactId>
</parent>

<groupId>oracle.code</groupId>
<artifactId>hat-backend-ptx</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>oracle.code</groupId>
<version>1.0</version>
<artifactId>hat</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
<!-- we want to inherit properties from parent but not the
plugin that calls cmake -->
</configuration>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
<!--We want to inherit properties from parent but not plugin that calls cmake-->
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy file="target/hat-backend-ptx-1.0.jar" todir="${hat.target}"/>
<copy file="target/hat-backend-ptx-1.0.jar" toDir="${hat.target}"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
1 change: 1 addition & 0 deletions hat/bldr/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--enable-preview --source 24 clean
36 changes: 36 additions & 0 deletions hat/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* vim: set ft=java:
*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

import static bldr.Bldr.*;

void main(String[] args) {
var hatDir = Dir.current();
var buildDir = hatDir.buildDir("build").remove();
hatDir.findDirs(path->path.getFileName().endsWith("target"))
.map(path->BuildDir.of(path))
.peek(dir->println("removing " +dir.path()))
.forEach(dir->dir.remove());
}
Loading

0 comments on commit 0101fa4

Please sign in to comment.