Skip to content

Commit

Permalink
IGNITE-17141 Use Maven to build .NET and update versions (apache#10087)
Browse files Browse the repository at this point in the history
* IGNITE-17141 Use maven for build .NET and update versions

* IGNITE-17141 Fix header

* IGNITE-17141 Fix cpp

* IGNITE-17141 Fix review comments

* Update DEVNOTES.txt

Co-authored-by: Pavel Tupitsyn <[email protected]>

* Update DEVNOTES.txt

Co-authored-by: Pavel Tupitsyn <[email protected]>

* IGNITE-17141 Fix review comments 2

* Update modules/platforms/dotnet/pom.xml

Co-authored-by: Pavel Tupitsyn <[email protected]>

* IGNITE-17141 Fix review comments for property naming

* IGNITE-17141 Fix review comments 3

* IGNITE-17141 Remove redundant dependency

* Update DEVNOTES.txt

Co-authored-by: Pavel Tupitsyn <[email protected]>

* Update DEVNOTES.txt

Co-authored-by: Pavel Tupitsyn <[email protected]>

* IGINTE-17141 fix redundant nl

Co-authored-by: Pavel Tupitsyn <[email protected]>
  • Loading branch information
Mmuzaf and ptupitsyn authored Jun 17, 2022
1 parent 84efe1c commit 6cd32f0
Show file tree
Hide file tree
Showing 11 changed files with 317 additions and 193 deletions.
30 changes: 13 additions & 17 deletions DEVNOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,26 @@ Further in our documentation, we always use the ./mvnw form. Please adapt it to

Apache Ignite Maven Build Instructions
======================================
1) Optional: build Apache Ignite.NET as described at modules/platforms/dotnet/DEVNOTES.txt.

2) Compile and install:
1) Compile and install:

./mvnw clean install -Pall-java,all-scala,licenses -DskipTests

or if you have built Apache Ignite.NET on the first step use following command:
(Note that 'doxygen' should be installed before running this command.)
or if you have to build .NET part as well, use the following command:
(Note that 'doxygen', `docfx`, '.NET Core SDK 3.1', 'PowerShell' should be installed before running this command.)

./mvnw clean install -Pall-java,all-scala,licenses -DskipTests -DclientDocs
./mvnw clean install -Pall-java,all-scala,licenses,platforms -DskipTests -DclientDocs

3) Javadoc generation (optional):
2) Javadoc generation (optional):

./mvnw initialize -Pjavadoc

4) Build Apache Ignite assembly:
3) Build Apache Ignite assembly:

./mvnw initialize -Prelease

Look for apache-ignite-<version>-bin.zip in ./target/bin directory.

5) Build Apache Ignite slim edition assembly:
4) Build Apache Ignite slim edition assembly:

./mvnw initialize -Prelease -Dignite.edition=apache-ignite-slim

Expand All @@ -42,22 +40,20 @@ Apache Ignite Maven Build Instructions

Apache Ignite with LGPL Maven Build Instructions
================================================
1) Optional: build Apache Ignite.NET as described at modules/platforms/dotnet/DEVNOTES.txt.

2) Compile and install:
1) Compile and install:

./mvnw clean install -Pall-java,all-scala,licenses -DskipTests

or if you have built Apache Ignite.NET on the first step use following command:
(Note that 'doxygen' should be installed before running this command.)
or if you have to build .NET part as well, use the following command:
(Note that 'doxygen', `docfx`, '.NET Core SDK 3.1', 'PowerShell' should be installed before running this command.)

./mvnw clean install -Pall-java,all-scala,licenses -DskipTests -DclientDocs
./mvnw clean install -Pall-java,all-scala,licenses,platforms -DskipTests -DclientDocs

3) Javadoc generation with LGPL (optional):
2) Javadoc generation with LGPL (optional):

./mvnw initialize -Pjavadoc,lgpl

4) Build Apache Ignite assembly with LGPL dependencies:
3) Build Apache Ignite assembly with LGPL dependencies:

./mvnw initialize -Prelease,lgpl -Dignite.edition=apache-ignite-lgpl

Expand Down
27 changes: 27 additions & 0 deletions modules/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,33 @@
<skip>false</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>update-versions</id>
<goals>
<goal>run</goal>
</goals>
<phase>initialize</phase>
<configuration>
<target>
<echo message="Update ignite.version in resource files" />

<replaceregexp byline="true" encoding="UTF-8">
<regexp pattern="(ignite.version=).+$" />
<substitution expression="\1${project.version}" />
<fileset dir="${project.basedir}/src/main/resources">
<include name="ignite.properties" />
</fileset>
</replaceregexp>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
27 changes: 23 additions & 4 deletions modules/ducktests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,29 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>update-versions</id>
<goals>
<goal>run</goal>
</goals>
<phase>initialize</phase>
<configuration>
<target>
<echo message="Update ignite.version in ducktests" />

<replaceregexp byline="true" encoding="UTF-8">
<regexp pattern="(__version__ = ).*$"/>
<substitution expression="\1'${project.version}'" />
<fileset dir="${basedir}/">
<include name="${project.basedir}/tests/ignitetest/__init__.py" />
</fileset>
</replaceregexp>
</target>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
Expand Down
2 changes: 1 addition & 1 deletion modules/platforms/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

cmake_minimum_required(VERSION 3.6)
project(Ignite.C++ VERSION 2.14.0.62943)
project(Ignite.C++ VERSION 2.14.0.22253)

set(CMAKE_CXX_STANDARD 98)

Expand Down
68 changes: 68 additions & 0 deletions modules/platforms/cpp/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!--
POM file.
-->
<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>

<parent>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-parent-internal</artifactId>
<version>${revision}</version>
<relativePath>../../../parent-internal/pom.xml</relativePath>
</parent>

<artifactId>ignite-cpp</artifactId>
<packaging>pom</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>update-versions</id>
<goals>
<goal>run</goal>
</goals>
<phase>initialize</phase>
<configuration>
<target>
<echo message="Update ignite.version in C++" />

<replaceregexp byline="true" encoding="UTF-8">
<regexp pattern="(project\(.*\s)\d+\.\d+\.\d+.*?(\))" />
<substitution expression="\1${ignite.platform.full.version}\2" />
<fileset dir="${project.basedir}/">
<include name="**/CMakeLists.txt" />
</fileset>
</replaceregexp>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
9 changes: 9 additions & 0 deletions modules/platforms/dotnet/DEVNOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ pwsh build.ps1

Resulting binaries will be in bin folder, and NuGet packages in nupkg folder.

Build Apache Ignite .NET with Maven
===================================

Note that .NET Core SDK 3.1 and PowerShell must be installed first.

The command below will build the binaries and NuGet packages with Maven:

./mvnw clean install -am -pl modules/platforms/dotnet -DskipTests -P platforms


Solutions and Projects
======================
Expand Down
4 changes: 2 additions & 2 deletions modules/platforms/dotnet/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("2.14.0.62943")]
[assembly: AssemblyFileVersion("2.14.0.62943")]
[assembly: AssemblyVersion("2.14.0.22253")]
[assembly: AssemblyFileVersion("2.14.0.22253")]
[assembly: AssemblyInformationalVersion("2.14.0")]
126 changes: 126 additions & 0 deletions modules/platforms/dotnet/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!--
POM file.
-->
<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>

<parent>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-parent-internal</artifactId>
<version>${revision}</version>
<relativePath>../../../parent-internal/pom.xml</relativePath>
</parent>

<artifactId>ignite-dotnet</artifactId>
<packaging>pom</packaging>

<dependencies>
<!--
The modules below are required to build the .NET sources.
These dependencies are required for the maven reactor to build them first.
-->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ignite-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ignite-indexing</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ignite-spring</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>update-versions</id>
<goals>
<goal>run</goal>
</goals>
<phase>initialize</phase>
<configuration>
<target>
<echo message="Update ignite.version in .NET" />

<replaceregexp byline="true" encoding="UTF-8">
<regexp pattern="(\[assembly:\s*Assembly\w*Version\w*\(&quot;)\d+\.\d+\.\d+(\.\d+)?(&quot;\)\])" />
<substitution expression="\1${ignite.platform.full.version}\3" />
<fileset dir="${basedir}/">
<include name="**/SharedAssemblyInfo.cs" />
</fileset>
</replaceregexp>

<replaceregexp byline="true" encoding="UTF-8">
<regexp pattern="(\[assembly:\s*AssemblyInformationalVersion\w*\(&quot;).*?(&quot;\)\])" />
<substitution
expression="\1${ignite.majorVersion}.${ignite.minorVersion}.${ignite.incrementalVersion}\2" />
<fileset dir="${basedir}/">
<include name="**/SharedAssemblyInfo.cs" />
</fileset>
</replaceregexp>
</target>
</configuration>
</execution>
<execution>
<id>build-dotnet</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<exec executable="pwsh" dir="${project.basedir}" failonerror="true">
<arg line="${project.basedir}/build.ps1"/>
<arg line="-skipJava -skipExamples"/>
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>clean-native</id>
<phase>clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>Basedir: ${project.basedir}</echo>
<delete dir="${project.basedir}/bin/"/>
<delete dir="${project.basedir}/nupkg/"/>
<delete dir="${project.basedir}/obj/"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 6cd32f0

Please sign in to comment.