Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
alternative solution -- profile
Browse files Browse the repository at this point in the history
  • Loading branch information
lanking520 committed Jul 10, 2018
1 parent cf88500 commit 034308a
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 27 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -584,36 +584,36 @@ rpkgtest:

scalaclean:
(cd $(ROOTDIR)/scala-package; \
mvn clean -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE))
mvn clean -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE),all)

scalapkg:
(cd $(ROOTDIR)/scala-package; \
mvn package -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) -Dcxx="$(CXX)" \
mvn package -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE),package -Dcxx="$(CXX)" \
-Dcflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dcurrent_libdir="$(ROOTDIR)/lib" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a")

scalaunittest:
(cd $(ROOTDIR)/scala-package; \
mvn integration-test -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) -Dcxx="$(CXX)" \
mvn integration-test -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE),unittest -Dcxx="$(CXX)" \
-Dcflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a" $(SCALA_TEST_ARGS))

scalaintegrationtest:
(cd $(ROOTDIR)/scala-package; \
mvn verify -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) -Dcxx="$(CXX)" \
mvn integration-test -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE),integrationtest -Dcxx="$(CXX)" \
-Dcflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a" $(SCALA_TEST_ARGS))

scalainstall:
(cd $(ROOTDIR)/scala-package; \
mvn install -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) -DskipTests -Dcxx="$(CXX)" \
mvn install -P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE),all -DskipTests -Dcxx="$(CXX)" \
-Dcflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a")

scaladeploy:
(cd $(ROOTDIR)/scala-package; \
mvn deploy -Prelease,$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) -DskipTests -Dcxx="$(CXX)" \
mvn deploy -Prelease,$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE),all -DskipTests -Dcxx="$(CXX)" \
-Dcflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a")

Expand Down
14 changes: 14 additions & 0 deletions scala-package/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
<name>MXNet Scala Package - Core</name>

<profiles>
<profile>
<id>unittest</id>
<properties>
<skiptest>false</skiptest>
</properties>
</profile>
<profile>
<id>integrationtest</id>
<properties>
<skiptest>true</skiptest>
</properties>
</profile>
<profile>
<id>osx-x86_64-cpu</id>
<properties>
Expand Down Expand Up @@ -55,6 +67,7 @@
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
<skipTests>${skiptest}</skipTests>
<argLine>
-Djava.library.path=${project.parent.basedir}/native/${platform}/target \
-Dlog4j.configuration=file://${project.basedir}/src/test/resources/log4j.properties
Expand All @@ -74,6 +87,7 @@
<artifactId>scala-maven-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<skip>${skiptest}</skip>
</configuration>
<executions>
<execution>
Expand Down
22 changes: 13 additions & 9 deletions scala-package/examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
<name>MXNet Scala Package - Examples</name>

<profiles>
<profile>
<id>unittest</id>
<properties>
<skiptest>true</skiptest>
</properties>
</profile>
<profile>
<id>integrationtest</id>
<properties>
<skiptest>false</skiptest>
</properties>
</profile>
<profile>
<id>osx-x86_64-cpu</id>
<properties>
Expand Down Expand Up @@ -129,20 +141,12 @@
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
<skipTests>${skiptest}</skipTests>
<argLine>
-Djava.library.path=${project.parent.basedir}/native/${platform}/target \
-Dlog4j.configuration=file://${project.basedir}/src/test/resources/log4j.properties
</argLine>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>verify</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scalastyle</groupId>
Expand Down
13 changes: 13 additions & 0 deletions scala-package/infer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
<name>MXNet Scala Package - Inference</name>

<profiles>
<profile>
<id>unittest</id>
<properties>
<skiptest>false</skiptest>
</properties>
</profile>
<profile>
<id>integrationtest</id>
<properties>
<skiptest>true</skiptest>
</properties>
</profile>
<profile>
<id>osx-x86_64-cpu</id>
<properties>
Expand Down Expand Up @@ -55,6 +67,7 @@
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
<skipTests>${skiptest}</skipTests>
<argLine>
-Djava.library.path=${project.parent.basedir}/native/${platform}/target \
-Dlog4j.configuration=file://${project.basedir}/src/test/resources/log4j.properties
Expand Down
13 changes: 13 additions & 0 deletions scala-package/macros/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
<name>MXNet Scala Package - Macros</name>

<profiles>
<profile>
<id>unittest</id>
<properties>
<skiptest>false</skiptest>
</properties>
</profile>
<profile>
<id>integrationtest</id>
<properties>
<skiptest>true</skiptest>
</properties>
</profile>
<profile>
<id>osx-x86_64-cpu</id>
<properties>
Expand Down Expand Up @@ -103,6 +115,7 @@
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
<skipTests>${skiptest}</skipTests>
<environmentVariables>
<MXNET_BASEDIR>${project.parent.basedir}/init-native</MXNET_BASEDIR>
</environmentVariables>
Expand Down
69 changes: 57 additions & 12 deletions scala-package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,64 @@
</properties>

<packaging>pom</packaging>
<modules>
<module>init</module>
<module>init-native</module>
<module>macros</module>
<module>core</module>
<module>native</module>
<module>infer</module>
<module>examples</module>
<module>spark</module>
<module>assembly</module>
</modules>

<profiles>
<profile>
<id>unittest</id>
<modules>
<module>init</module>
<module>init-native</module>
<module>macros</module>
<module>core</module>
<module>native</module>
<module>infer</module>
</modules>
</profile>
<profile>
<id>integrationtest</id>
<modules>
<module>init</module>
<module>init-native</module>
<module>macros</module>
<module>core</module>
<module>native</module>
<module>infer</module>
<module>examples</module>
<module>spark</module>
</modules>
</profile>
<profile>
<id>package</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>init</module>
<module>init-native</module>
<module>macros</module>
<module>core</module>
<module>native</module>
<module>infer</module>
<module>assembly</module>
</modules>
</profile>
<profile>
<id>all</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>init</module>
<module>init-native</module>
<module>macros</module>
<module>core</module>
<module>native</module>
<module>infer</module>
<module>examples</module>
<module>spark</module>
<module>assembly</module>
</modules>
</profile>
<profile>
<id>release</id>
<build>
Expand Down Expand Up @@ -335,7 +380,7 @@
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
<goal>aggregate-jar</goal>
</goals>
</execution>
</executions>
Expand Down

0 comments on commit 034308a

Please sign in to comment.