mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
creating one package which includes sqltoolsservice and credential service (#444)
* creating one package which includes sqltoolsservice and credential service * adding logDir arg to credentials program
This commit is contained in:
20
build.cake
20
build.cake
@@ -41,6 +41,7 @@ public class BuildPlan
|
|||||||
public string ArtifactsFolder { get; set; }
|
public string ArtifactsFolder { get; set; }
|
||||||
public bool UseSystemDotNetPath { get; set; }
|
public bool UseSystemDotNetPath { get; set; }
|
||||||
public string DotNetFolder { get; set; }
|
public string DotNetFolder { get; set; }
|
||||||
|
public string PackageName { get; set; }
|
||||||
public string DotNetInstallScriptURL { get; set; }
|
public string DotNetInstallScriptURL { get; set; }
|
||||||
public string DotNetChannel { get; set; }
|
public string DotNetChannel { get; set; }
|
||||||
public string DotNetVersion { get; set; }
|
public string DotNetVersion { get; set; }
|
||||||
@@ -313,6 +314,7 @@ Task("OnlyPublish")
|
|||||||
.IsDependentOn("CodeGen")
|
.IsDependentOn("CodeGen")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
|
var packageName = buildPlan.PackageName;
|
||||||
foreach (var project in buildPlan.MainProjects)
|
foreach (var project in buildPlan.MainProjects)
|
||||||
{
|
{
|
||||||
var projectFolder = System.IO.Path.Combine(sourceFolder, project);
|
var projectFolder = System.IO.Path.Combine(sourceFolder, project);
|
||||||
@@ -320,7 +322,7 @@ Task("OnlyPublish")
|
|||||||
{
|
{
|
||||||
foreach (var runtime in buildPlan.Rids)
|
foreach (var runtime in buildPlan.Rids)
|
||||||
{
|
{
|
||||||
var outputFolder = System.IO.Path.Combine(publishFolder, project, runtime, framework);
|
var outputFolder = System.IO.Path.Combine(publishFolder, packageName, runtime, framework);
|
||||||
var publishArguments = "publish";
|
var publishArguments = "publish";
|
||||||
if (!runtime.Equals("default"))
|
if (!runtime.Equals("default"))
|
||||||
{
|
{
|
||||||
@@ -337,12 +339,20 @@ Task("OnlyPublish")
|
|||||||
{
|
{
|
||||||
Run("install_name_tool", "-add_rpath /usr/local/opt/openssl/lib " + outputFolder + "/System.Security.Cryptography.Native.dylib");
|
Run("install_name_tool", "-add_rpath /usr/local/opt/openssl/lib " + outputFolder + "/System.Security.Cryptography.Native.dylib");
|
||||||
}
|
}
|
||||||
if (requireArchive)
|
|
||||||
{
|
|
||||||
Package(runtime, framework, outputFolder, packageFolder, project.ToLower(), workingDirectory);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requireArchive)
|
||||||
|
{
|
||||||
|
foreach (var framework in buildPlan.Frameworks)
|
||||||
|
{
|
||||||
|
foreach (var runtime in buildPlan.Rids)
|
||||||
|
{
|
||||||
|
var outputFolder = System.IO.Path.Combine(publishFolder, packageName, runtime, framework);
|
||||||
|
Package(runtime, framework, outputFolder, packageFolder, packageName, workingDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
CreateRunScript(System.IO.Path.Combine(publishFolder, project, "default"), scriptFolder);
|
CreateRunScript(System.IO.Path.Combine(publishFolder, project, "default"), scriptFolder);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"DotNetVersion": "1.0.0-preview2-003121",
|
"DotNetVersion": "1.0.0-preview2-003121",
|
||||||
"BuildToolsFolder": ".tools",
|
"BuildToolsFolder": ".tools",
|
||||||
"ArtifactsFolder": "artifacts",
|
"ArtifactsFolder": "artifacts",
|
||||||
|
"PackageName": "Microsoft.SqlTools.ServiceLayer",
|
||||||
"TestProjects": {
|
"TestProjects": {
|
||||||
"Microsoft.SqlTools.ServiceLayer.UnitTests": [
|
"Microsoft.SqlTools.ServiceLayer.UnitTests": [
|
||||||
"netcoreapp2.0"
|
"netcoreapp2.0"
|
||||||
|
|||||||
@@ -102,12 +102,13 @@ void CopyEulas(string runtime, string framework, string contentFolder, string pa
|
|||||||
"*.RTF",
|
"*.RTF",
|
||||||
SearchOption.AllDirectories).ToList();
|
SearchOption.AllDirectories).ToList();
|
||||||
|
|
||||||
foreach (var file in files) {
|
foreach (var file in files)
|
||||||
System.IO.File.Copy(
|
{
|
||||||
file,
|
var dest = System.IO.Path.Combine(contentFolder, System.IO.Path.GetFileName(file));
|
||||||
System.IO.Path.Combine(
|
if (!System.IO.File.Exists(dest))
|
||||||
contentFolder,
|
{
|
||||||
System.IO.Path.GetFileName(file)));
|
System.IO.File.Copy(file, dest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using Microsoft.SqlTools.Credentials.Utility;
|
using Microsoft.SqlTools.Credentials.Utility;
|
||||||
using Microsoft.SqlTools.ServiceLayer.SqlContext;
|
using Microsoft.SqlTools.ServiceLayer.SqlContext;
|
||||||
using Microsoft.SqlTools.Utility;
|
using Microsoft.SqlTools.Utility;
|
||||||
@@ -28,9 +29,15 @@ namespace Microsoft.SqlTools.Credentials
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string logFilePath = "credentials";
|
||||||
|
if (!string.IsNullOrWhiteSpace(commandOptions.LoggingDirectory))
|
||||||
|
{
|
||||||
|
logFilePath = Path.Combine(commandOptions.LoggingDirectory, logFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
// turn on Verbose logging during early development
|
// turn on Verbose logging during early development
|
||||||
// we need to switch to Normal when preparing for public preview
|
// we need to switch to Normal when preparing for public preview
|
||||||
Logger.Initialize(minimumLogLevel: LogLevel.Verbose, isEnabled: commandOptions.EnableLogging);
|
Logger.Initialize(logFilePath, minimumLogLevel: LogLevel.Verbose, isEnabled: commandOptions.EnableLogging);
|
||||||
Logger.Write(LogLevel.Normal, "Starting SqlTools Credentials Provider");
|
Logger.Write(LogLevel.Normal, "Starting SqlTools Credentials Provider");
|
||||||
|
|
||||||
// set up the host details and profile paths
|
// set up the host details and profile paths
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.Credentials.Utility
|
namespace Microsoft.SqlTools.Credentials.Utility
|
||||||
{
|
{
|
||||||
@@ -26,11 +27,19 @@ namespace Microsoft.SqlTools.Credentials.Utility
|
|||||||
string arg = args[i];
|
string arg = args[i];
|
||||||
if (arg.StartsWith("--") || arg.StartsWith("-"))
|
if (arg.StartsWith("--") || arg.StartsWith("-"))
|
||||||
{
|
{
|
||||||
|
if (arg.StartsWith("--"))
|
||||||
|
{
|
||||||
|
// Extracting arguments and properties
|
||||||
|
arg = arg.Substring(1).ToLowerInvariant();
|
||||||
|
}
|
||||||
switch (arg)
|
switch (arg)
|
||||||
{
|
{
|
||||||
case "-enable-logging":
|
case "-enable-logging":
|
||||||
EnableLogging = true;
|
EnableLogging = true;
|
||||||
break;
|
break;
|
||||||
|
case "-log-dir":
|
||||||
|
SetLoggingDirectory(args[++i]);
|
||||||
|
break;
|
||||||
case "h":
|
case "h":
|
||||||
case "-help":
|
case "-help":
|
||||||
ShouldExit = true;
|
ShouldExit = true;
|
||||||
@@ -64,11 +73,26 @@ namespace Microsoft.SqlTools.Credentials.Utility
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool EnableLogging { get; private set; }
|
public bool EnableLogging { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the directory where log files are output.
|
||||||
|
/// </summary>
|
||||||
|
public string LoggingDirectory { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the program should exit immediately. Set to true when the usage is printed.
|
/// Whether the program should exit immediately. Set to true when the usage is printed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShouldExit { get; private set; }
|
public bool ShouldExit { get; private set; }
|
||||||
|
|
||||||
|
private void SetLoggingDirectory(string loggingDirectory)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(loggingDirectory))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.LoggingDirectory = Path.GetFullPath(loggingDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the usage string describing command-line arguments for the program
|
/// Get the usage string describing command-line arguments for the program
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user