Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3_0_X][TIMOB-25895] Add Windows SDK 7.1.1 compatibility #277

Merged
merged 5 commits into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.axway.AppcCLI;
def nodeVersion = '8.9.0'
def platformEnvironment = 'prod' // 'preprod'
def credentialsId = '895d8db1-87c2-4d96-a786-349c2ed2c04a' // preprod = '65f9aaaf-cfef-4f22-a8aa-b1fb0d934b64'
def sdkVersion = '7.0.0.v20171108114616' // Use master build with Windows DLL & removed 8.1, newer v8 api level *and* Android ARM64 support
def sdkVersion = '7.1.1.v20180329185637' // Use master build with Windows DLL & removed 8.1, newer v8 api level *and* Android ARM64 support
def androidAPILevel = '26'

// gets assigned once we read the package.json file
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hyperloop",
"version": "3.0.3",
"version": "3.0.4",
"description": "Access native APIs from within Titanium.",
"keywords": [
"appcelerator",
Expand Down
13 changes: 10 additions & 3 deletions windows/cmake/FindHAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@ set_target_properties(HAL PROPERTIES
INTERFACE_HAL_MAJOR_VERSION "0"
)

set_target_properties(HAL PROPERTIES
IMPORTED_IMPLIB "${WINDOWS_SOURCE_DIR}/lib/HAL/${PLATFORM}/${HAL_ARCH}/HAL.lib"
IMPORTED_LOCATION "${WINDOWS_SOURCE_DIR}/lib/HAL/${PLATFORM}/${HAL_ARCH}/HAL.dll"
if (HAL_RENAME_AXWAYHAL)
set_target_properties(HAL PROPERTIES
IMPORTED_IMPLIB "${WINDOWS_SOURCE_DIR}/lib/HAL/${PLATFORM}/${HAL_ARCH}/AXWAYHAL.lib"
IMPORTED_LOCATION "${WINDOWS_SOURCE_DIR}/lib/HAL/${PLATFORM}/${HAL_ARCH}/AXWAYHAL.dll"
)
else()
set_target_properties(HAL PROPERTIES
IMPORTED_IMPLIB "${WINDOWS_SOURCE_DIR}/lib/HAL/${PLATFORM}/${HAL_ARCH}/HAL.lib"
IMPORTED_LOCATION "${WINDOWS_SOURCE_DIR}/lib/HAL/${PLATFORM}/${HAL_ARCH}/HAL.dll"
)
endif()

# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
Expand Down
Binary file removed windows/dist/hyperloop-windows-2.2.0.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions windows/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# during compilation, packaging, distribution, etc.
#
version: VERSION
apiversion: 4
apiversion: 5
architectures: ARM x86
description: hyperloop
author: Appcelerator
Expand All @@ -17,4 +17,4 @@ moduleIdAsIdentifier: Hyperloop
classname: HyperloopModule
guid: bdaca69f-b316-4ce6-9065-7a61e1dafa39
platform: windows
minsdk: 7.0.0
minsdk: 7.1.1
71 changes: 19 additions & 52 deletions windows/plugins/hooks/hyperloop.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
/**
* Hyperloop ® builder for Windows
* Copyright (c) 2018 by Appcelerator, Inc.
* All Rights Reserved. This library contains intellectual
* property protected by patents and/or patents pending.
*
*
* THIS IS A PLUGIN FOR "BUILDING HYPERLOOP MODULE" BINARY
* THIS IS NOT A PLUGIN HOOK FOR BUILDING TITANIUM APP!
*/
var spawn = require('child_process').spawn,
async = require('async'),
path = require('path'),
fs = require('fs'),
ejs = require('ejs'),
appc = require('node-appc');
appc = require('node-appc'),
wrench = require('wrench');

function isVS2017(data) {
if (data.windowsInfo && data.windowsInfo.selectedVisualStudio) {
Expand All @@ -22,12 +33,6 @@ exports.init = function(logger, config, cli, nodeappc) {
function(next) {
generateCMakeList(data, next);
},
function(next) {
runCmake(data, 'WindowsStore', 'Win32', '10.0', next);
},
function(next) {
runCmake(data, 'WindowsStore', 'ARM', '10.0', next);
},
];

data.projectDir = cli.argv['project-dir'];
Expand Down Expand Up @@ -81,10 +86,13 @@ exports.init = function(logger, config, cli, nodeappc) {
});
});

var sharedInitHook = path.join(data.projectDir, '..', 'hooks', 'hyperloop-init.js');
if (fs.existsSync(sharedInitHook)) {
fs.createReadStream(sharedInitHook).pipe(fs.createWriteStream(path.join(data.projectDir, 'hooks', 'hyperloop-init.js')));
}
// Copy hooks
var hooksFrom = path.join(data.projectDir, 'hooks'),
hooksTo = path.join(data.projectDir, 'build', 'hyperloop', data.manifest.version, 'hooks')
fs.existsSync(hooksTo) || wrench.mkdirSyncRecursive(hooksTo);
wrench.copyDirSyncRecursive(hooksFrom, hooksTo, {
forceDelete: true
});

callback(null, data);
});
Expand Down Expand Up @@ -118,47 +126,6 @@ function generateCMakeList(data, next) {

}

function runCmake(data, platform, arch, sdkVersion, next) {
var logger = data.logger,
generatorName = (isVS2017(data) ? 'Visual Studio 15 2017' : 'Visual Studio 14 2015') + (arch==='ARM' ? ' ARM' : ''),
cmakeProjectName = (sdkVersion === '10.0' ? 'Windows10' : platform) + '.' + arch,
cmakeWorkDir = path.resolve(__dirname,'..','..',cmakeProjectName);

logger.debug('Run CMake on ' + cmakeWorkDir);

if (!fs.existsSync(cmakeWorkDir)) {
fs.mkdirSync(cmakeWorkDir);
}

var p = spawn(path.join(data.titaniumSdkPath,'windows','cli','vendor','cmake','bin','cmake.exe'),
[
'-G', generatorName,
'-DCMAKE_SYSTEM_NAME=' + platform,
'-DCMAKE_SYSTEM_VERSION=' + sdkVersion,
'-DCMAKE_BUILD_TYPE=Debug',
path.resolve(__dirname,'..','..')
],
{
cwd: cmakeWorkDir
});
p.on('error', function(err) {
logger.error(cmake);
logger.error(err);
});
p.stdout.on('data', function (data) {
logger.info(data.toString().trim());
});
p.stderr.on('data', function (data) {
logger.warn(data.toString().trim());
});
p.on('close', function (code) {
if (code != 0) {
process.exit(1); // Exit with code from cmake?
}
next();
});
}

function buildSolution(data, dest, platform, buildConfig, callback) {
var slnFile = path.join(dest, platform, 'HyperloopInvocation.sln');
runNuGet(data, slnFile, function(err) {
Expand Down