This is an automated email from the ASF dual-hosted git repository.
mpochatkin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new f8de23cd24 IGNITE-22408 Create MSI package for ODBC (#4041)
f8de23cd24 is described below
commit f8de23cd24a86e7ceb1ac71478c6adf850719e0d
Author: Vadim Pakhnushev <[email protected]>
AuthorDate: Thu Jul 4 17:08:03 2024 +0300
IGNITE-22408 Create MSI package for ODBC (#4041)
---
gradle/libs.versions.toml | 2 +-
modules/platforms/build.gradle | 18 ++++++++++++-----
packaging/odbc/build.gradle | 45 +++++++++++++++++++++++++++++++++++++++---
packaging/odbc/template.wxs | 38 +++++++++++++++++++++++++++++++++++
4 files changed, 94 insertions(+), 9 deletions(-)
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 8912fc4160..72451c8a99 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -97,7 +97,7 @@ cmake = "net.freudasoft.gradle-cmake-plugin:0.0.4"
nebula = "com.netflix.nebula.ospackage:11.9.1"
docker = "com.palantir.docker:0.36.0"
checksum = "org.gradle.crypto.checksum:1.4.0"
-setupbuilder = "de.inetsoftware.setupbuilder:7.2.21"
+setupbuilder = "de.inetsoftware.setupbuilder:8.4.21"
aggregateJavadoc = "io.freefair.aggregate-javadoc:6.6.3"
ideaext = "org.jetbrains.gradle.plugin.idea-ext:1.1.8"
spotbugs = "com.github.spotbugs:6.0.18"
diff --git a/modules/platforms/build.gradle b/modules/platforms/build.gradle
index a8c538557f..5d58fc089d 100644
--- a/modules/platforms/build.gradle
+++ b/modules/platforms/build.gradle
@@ -21,6 +21,7 @@ plugins {
alias(libs.plugins.cmake)
}
+import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.crypto.checksum.Checksum
configurations {
@@ -185,11 +186,18 @@ artifacts {
cppClient(file("$buildDir/cpp/lib/libignite3-client.so")) {
builtBy cmakeBuildClient
}
- odbc(file("$buildDir/cpp/lib/libignite3-odbc.so")) {
- builtBy cmakeBuildOdbc
- }
- odbc(file("$buildDir/cpp/lib/libignite3-odbc.so.3")) {
- builtBy cmakeBuildOdbc
+
+ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
+ odbc(file("$buildDir/cpp/Release/bin/ignite3-odbc.dll")) {
+ builtBy cmakeBuildOdbc
+ }
+ } else {
+ odbc(file("$buildDir/cpp/lib/libignite3-odbc.so")) {
+ builtBy cmakeBuildOdbc
+ }
+ odbc(file("$buildDir/cpp/lib/libignite3-odbc.so.3")) {
+ builtBy cmakeBuildOdbc
+ }
}
}
}
diff --git a/packaging/odbc/build.gradle b/packaging/odbc/build.gradle
index 3bcf281dfe..14af8a5daa 100644
--- a/packaging/odbc/build.gradle
+++ b/packaging/odbc/build.gradle
@@ -23,6 +23,7 @@ plugins {
id 'signing'
alias(libs.plugins.nebula)
alias(libs.plugins.checksum)
+ alias(libs.plugins.setupbuilder)
}
java {
@@ -44,19 +45,34 @@ def tokens = [
TMP_DIR : "/tmp/ignite3-odbc"
]
-task replacePackageScriptVars(type: Copy) {
+def tokensWin = [
+ DLL_SRC : configurations.odbc.files.find { it.name ==
"ignite3-odbc.dll"}
+]
+
+tasks.register('replacePackageScriptVars', Copy) {
onlyIf {
project.hasProperty('platforms.enable')
}
- from "$rootDir/packaging/odbc/ignite3-odbc.ini"
+ from 'ignite3-odbc.ini'
- from "$rootDir/packaging/odbc/scripts"
+ from 'scripts'
filter(ReplaceTokens, tokens: tokens)
into "$buildDir/scripts/"
}
+tasks.register('replacePackageScriptVarsWin', Copy) {
+ onlyIf {
+ project.hasProperty('platforms.enable')
+ }
+
+ from 'template.wxs'
+
+ filter(ReplaceTokens, tokens: tokensWin)
+ into "$buildDir/scripts/"
+}
+
distributions {
main {
distributionBaseName = 'ignite3-odbc'
@@ -131,3 +147,26 @@ ospackage {
from "$buildDir/scripts/ignite3-odbc.ini"
}
}
+
+setupBuilder {
+ vendor = "Apache Software Foundation"
+ application = "Apache Ignite ODBC driver"
+ description = "Apache Ignite is a distributed database for
high-performance computing with in-memory speed"
+ appIdentifier = "ignite3-odbc"
+
+ // '-SNAPSHOT' is not valid in Windows versions
+ version = project.version.toString().replace("-SNAPSHOT", "")
+
+ licenseFile = "$rootDir/LICENSE"
+
+ msi {
+ dependsOn replacePackageScriptVarsWin
+
+ languages = ["en-US"]
+ wxsTemplate = "$buildDir/scripts/template.wxs"
+ }
+
+ into('bin') {
+ from configurations.odbc
+ }
+}
diff --git a/packaging/odbc/template.wxs b/packaging/odbc/template.wxs
new file mode 100644
index 0000000000..4b86324c4c
--- /dev/null
+++ b/packaging/odbc/template.wxs
@@ -0,0 +1,38 @@
+<?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.
+-->
+
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product >
+ <DirectoryRef Id="INSTALLDIR">
+ <Directory Id="bin" Name="bin">
+ <Component Id="bin_Comp">
+<!-- ODBCDriver doesn't work because it references the
FileName which is in the form of SFN|LFN -->
+<!-- <ODBCDriver Id="ingite3_odbc_Driver" Name="Apache
Ignite 3" File="bin_ignite3_odbc.dll" /> -->
+
+ <File Id="bin_ignite3_odbc.dll" Name="ignite3-odbc.dll"
Source="@DLL_SRC@"/>
+ <RegistryValue Id="ingite3_odbc.reg.1" Root="HKLM"
Key="SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" Name="Apache Ignite 3"
Type="string" Value="Installed" />
+ <RegistryValue Id="ingite3_odbc.reg.2" Root="HKLM"
Key="SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite 3" Name="Driver" Type="string"
Value="[#bin_ignite3_odbc.dll]" />
+ <RegistryValue Id="ingite3_odbc.reg.3" Root="HKLM"
Key="SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite 3" Name="DriverODBCVer"
Type="string" Value="03.80" />
+ <RegistryValue Id="ingite3_odbc.reg.4" Root="HKLM"
Key="SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite 3" Name="Setup" Type="string"
Value="[#bin_ignite3_odbc.dll]" />
+ <RegistryValue Id="ingite3_odbc.reg.5" Root="HKLM"
Key="SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite 3" Name="UsageCount"
Type="integer" Value="1" />
+ </Component>
+ </Directory>
+ </DirectoryRef>
+ </Product>
+</Wix>