diff --git a/appveyor.yml b/appveyor.yml index 7ec6631..ee8e818 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,8 @@ -version: 2.6.{build} +version: 2.7.{build} image: Visual Studio 2017 clone_folder: C:\CodePulse build_script: -- cmd: powershell -file C:\CodePulse\installers\build.ps1 -version 2.6.2 -versionForDotNetTracerWindowsDownloadUrl 2.6.2 -useGitHubDotNetTracerWindowsDownloadUrl +- cmd: powershell -file C:\CodePulse\installers\build.ps1 -version 2.7.0 -versionForDotNetTracerWindowsDownloadUrl 2.7.0 -useGitHubDotNetTracerWindowsDownloadUrl # - cmd: powershell -file C:\CodePulse\installers\build.ps1 -version %APPVEYOR_BUILD_VERSION% -versionForDotNetTracerWindowsDownloadUrl %APPVEYOR_JOB_ID% -skipMac -skipLinux # skips building packages for macOS and Linux before_test: - cmd: >- @@ -31,11 +31,11 @@ after_test: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", "C:\CodePulse\OpenCover.Test.Profiler.x64.xml") artifacts: -- path: installers\CodePulse-2.6.2-Linux-x64.zip # Comment out when using -skipLinux switch +- path: installers\CodePulse-2.7.0-Linux-x64.zip # Comment out when using -skipLinux switch name: Code Pulse Linux # -- path: installers\CodePulse-2.6.2-macOS-x64.zip # Comment out when using -skipMac switch +- path: installers\CodePulse-2.7.0-macOS-x64.zip # Comment out when using -skipMac switch name: Code Pulse Mac # -- path: installers\CodePulse-2.6.2-Windows-x64.zip +- path: installers\CodePulse-2.7.0-Windows-x64.zip name: Code Pulse Windows -- path: installers\CodePulse-DotNetTracer-2.6.2-Windows.zip +- path: installers\CodePulse-DotNetTracer-2.7.0-Windows.zip name: Code Pulse .NET Tracer diff --git a/codepulse/src/main/resources/application.conf b/codepulse/src/main/resources/application.conf index abcda82..e2076e7 100644 --- a/codepulse/src/main/resources/application.conf +++ b/codepulse/src/main/resources/application.conf @@ -18,7 +18,8 @@ cp { codedxLoggingLevel = "INFO" bootstrapLoggingLevel = "INFO" liftwebLoggingLevel = "WARN" - } + }, + maxFileUploadSizeMebibytes = 500 }, systemSettings { symbolService { @@ -26,4 +27,4 @@ cp { location = "dotnet-symbol-service/publish/" } } -} \ No newline at end of file +} diff --git a/codepulse/src/main/resources/toserve/pages/ProjectInputForm/ProjectInputForm.js b/codepulse/src/main/resources/toserve/pages/ProjectInputForm/ProjectInputForm.js index 32ae5b0..5f0af34 100644 --- a/codepulse/src/main/resources/toserve/pages/ProjectInputForm/ProjectInputForm.js +++ b/codepulse/src/main/resources/toserve/pages/ProjectInputForm/ProjectInputForm.js @@ -82,15 +82,24 @@ $(document).ready(function(){ url: uploadUrl, dropZone: fileDropzone, add: function(e, data){ - if (data.files[0].size > 524288000) { - alert('The file you specified exceeds the maximum file size (500 MB).'); - projectFile.set(null); - return - } - - // use this `data` as the current file data. - // this will be used once the form is submitted. - projectFile.set(data) + + $.ajax('/api/user-settings', { + error: function(xhr, status){ + alert('Unable to fetch user settings that affect file upload') + projectFile.set(null) + }, + success: function(userSettings){ + if (data.files[0].size > userSettings.maxFileUploadSizeBytes) { + alert('The file you specified exceeds the maximum file size (' + userSettings.maxFileUploadSizeBytes / (1024*1024) + ' MB).') + projectFile.set(null) + return + } + + // use this `data` as the current file data. + // this will be used once the form is submitted. + projectFile.set(data) + } + }) }, formData: function(){ var name = projectName.get() @@ -398,4 +407,4 @@ $(document).ready(function(){ } } -}) \ No newline at end of file +}) diff --git a/codepulse/src/main/scala/bootstrap/liftweb/FileUploadSetup.scala b/codepulse/src/main/scala/bootstrap/liftweb/FileUploadSetup.scala index d526775..1ef19ac 100644 --- a/codepulse/src/main/scala/bootstrap/liftweb/FileUploadSetup.scala +++ b/codepulse/src/main/scala/bootstrap/liftweb/FileUploadSetup.scala @@ -22,26 +22,23 @@ package bootstrap.liftweb import java.io.File import java.io.IOException -import scala.util.control.Exception.catching +import com.secdec.codepulse.userSettings +import scala.util.control.Exception.catching import org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException import org.apache.commons.io.FileUtils import org.apache.commons.io.FilenameUtils import org.apache.commons.io.IOUtils - import net.liftweb.common.Loggable import net.liftweb.http.JsonResponse import net.liftweb.http.LiftRules import net.liftweb.http.LiftRulesMocker.toLiftRules import net.liftweb.json.JsonDSL.pair2jvalue import net.liftweb.json.JsonDSL.string2jvalue - import com.secdec.codepulse.util.ManualOnDiskFileParamHolder object FileUploadSetup extends Loggable { - val MaxFileSize = 500 * 1024 * 1024 - def init(liftRules: LiftRules) = { setupMimeHandler(liftRules) setupUploadProgress(liftRules) @@ -56,8 +53,9 @@ object FileUploadSetup extends Loggable { def setupMimeHandler(liftRules: LiftRules) = { - liftRules.maxMimeFileSize = MaxFileSize - liftRules.maxMimeSize = MaxFileSize + val size = userSettings.maxFileUploadSizeBytes + liftRules.maxMimeFileSize = size + liftRules.maxMimeSize = size // Send uploaded files to a temp folder instead of putting them in memory liftRules.handleMimeFile = (fieldName, contentType, fileName, stream) => { diff --git a/codepulse/src/main/scala/com/secdec/codepulse/data/dotnet/Lifetime.scala b/codepulse/src/main/scala/com/secdec/codepulse/data/dotnet/Lifetime.scala index a52fde9..60095c6 100644 --- a/codepulse/src/main/scala/com/secdec/codepulse/data/dotnet/Lifetime.scala +++ b/codepulse/src/main/scala/com/secdec/codepulse/data/dotnet/Lifetime.scala @@ -49,8 +49,8 @@ class SymbolService extends Lifetime with Loggable { var binaryCanonical = new File(binaryPath).getCanonicalPath logger.debug(s"attempting to start $binaryCanonical using $url...") - process = Some(Process(s"$binaryPath", new java.io.File(symbolServiceLocation), "ASPNETCORE_URLS" -> url).run()) - logger.debug(s"created SymbolService from $binaryPath") + process = Some(Process(s"$binaryCanonical", new java.io.File(symbolServiceLocation), "ASPNETCORE_URLS" -> url).run()) + logger.debug(s"created SymbolService from $binaryCanonical") def shutdown(area: String): () => Unit = { () => { @@ -82,4 +82,4 @@ class SymbolService extends Lifetime with Loggable { process.foreach(p => logger.debug(s"process exited with exit value ${p.exitValue}")) process = None } -} \ No newline at end of file +} diff --git a/codepulse/src/main/scala/com/secdec/codepulse/package.scala b/codepulse/src/main/scala/com/secdec/codepulse/package.scala index b648bcb..e463d95 100644 --- a/codepulse/src/main/scala/com/secdec/codepulse/package.scala +++ b/codepulse/src/main/scala/com/secdec/codepulse/package.scala @@ -21,17 +21,16 @@ package com.secdec import java.text.SimpleDateFormat import java.util.Properties + import scala.collection.JavaConverters.propertiesAsScalaMapConverter import scala.util.Try import com.secdec.codepulse.util.ApplicationData import com.secdec.codepulse.util.Implicits._ -import com.typesafe.config.Config -import com.typesafe.config.ConfigFactory +import com.typesafe.config.{Config, ConfigException, ConfigFactory, ConfigRenderOptions, ConfigValueFactory} import java.io.File -import com.typesafe.config.ConfigRenderOptions import java.io.FileWriter + import ch.qos.logback.classic.Level -import com.typesafe.config.ConfigValueFactory /** @author dylanh * @@ -91,6 +90,17 @@ package object codepulse { newPort } + def maxFileUploadSizeBytes: Int = { + val mebibytes = 1024 * 1024 + val defaultMaxSizeBytes = 500 * mebibytes + try { + val sizeMebibytes = config.getInt("cp.userSettings.maxFileUploadSizeMebibytes") + if (sizeMebibytes > 0) sizeMebibytes * mebibytes else defaultMaxSizeBytes + } catch { + case _: com.typesafe.config.ConfigException.Missing => defaultMaxSizeBytes + } + } + def symbolServicePort = config.getString("cp.userSettings.symbolService.port") def skipUserAcknowledgment = config.getBoolean("cp.userSettings.skipUserAcknowledgment") @@ -153,7 +163,7 @@ package object codepulse { // preserve option to skip user ack via an environment variable val allowAgentToAcceptTraceConnectionPattern = """(skipUserAcknowledgment="?(?:false|true|yes|no)"?)""".r - val outputWithSkipAck = allowAgentToAcceptTraceConnectionPattern.replaceFirstIn(outputWithServicePort, "$1\n" + " " * 12 + "skipUserAcknowledgment=\\${?CODE_PULSE_SKIP_ACK}") + val outputWithSkipAck = allowAgentToAcceptTraceConnectionPattern.replaceFirstIn(outputWithServicePort, "$1\n" + " " * 12 + "skipUserAcknowledgment=\\${?CODE_PULSE_TRACE_SKIP_ACK}") val writer = new FileWriter(configFile) writer.write(outputWithSkipAck) diff --git a/codepulse/src/main/scala/com/secdec/codepulse/tracer/APIServer.scala b/codepulse/src/main/scala/com/secdec/codepulse/tracer/APIServer.scala index 75b6ffe..4174baa 100644 --- a/codepulse/src/main/scala/com/secdec/codepulse/tracer/APIServer.scala +++ b/codepulse/src/main/scala/com/secdec/codepulse/tracer/APIServer.scala @@ -460,6 +460,10 @@ class APIServer(manager: ProjectManager, treeBuilderManager: TreeBuilderManager, case _ => PlainTextResponse("Unknown error.", 500) } + case List("api", "user-settings") Get req => + val settings: JObject = "maxFileUploadSizeBytes" -> userSettings.maxFileUploadSizeBytes + JsonResponse(settings) + // GET the agent string case List("api", "agent-string") Get req => PlainTextResponse(ConnectionHelp.traceAgentCommand) diff --git a/dotnet-symbol-service/SymbolService/Controllers/MethodsController.cs b/dotnet-symbol-service/SymbolService/Controllers/MethodsController.cs index 434e9ce..98df6da 100644 --- a/dotnet-symbol-service/SymbolService/Controllers/MethodsController.cs +++ b/dotnet-symbol-service/SymbolService/Controllers/MethodsController.cs @@ -27,6 +27,7 @@ namespace SymbolService.Controllers { + [ApiController] [Produces("application/json")] [Route("api/Methods")] public class MethodsController : Controller diff --git a/dotnet-symbol-service/SymbolService/Program.cs b/dotnet-symbol-service/SymbolService/Program.cs index a2e15c5..a42bcc2 100644 --- a/dotnet-symbol-service/SymbolService/Program.cs +++ b/dotnet-symbol-service/SymbolService/Program.cs @@ -14,8 +14,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; namespace SymbolService { @@ -23,12 +23,14 @@ public class Program { public static void Main(string[] args) { - BuildWebHost(args).Run(); + CreateHostBuilder(args).Build().Run(); } - public static IWebHost BuildWebHost(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup() - .Build(); + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); } } diff --git a/dotnet-symbol-service/SymbolService/Startup.cs b/dotnet-symbol-service/SymbolService/Startup.cs index 3726aa2..1d1c980 100644 --- a/dotnet-symbol-service/SymbolService/Startup.cs +++ b/dotnet-symbol-service/SymbolService/Startup.cs @@ -18,7 +18,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Hosting; namespace SymbolService { @@ -34,21 +34,23 @@ public Startup(IConfiguration configuration) // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddMvc(); + services.AddControllers(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { - loggerFactory.AddConsole(Configuration.GetSection("Logging")); - loggerFactory.AddDebug(); - if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } - app.UseMvc(); + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); } } } diff --git a/dotnet-symbol-service/SymbolService/SymbolService.csproj b/dotnet-symbol-service/SymbolService/SymbolService.csproj index 1875801..ec2207a 100644 --- a/dotnet-symbol-service/SymbolService/SymbolService.csproj +++ b/dotnet-symbol-service/SymbolService/SymbolService.csproj @@ -1,16 +1,11 @@ - netcoreapp2.0 + netcoreapp3.1 SymbolService - - - - - diff --git a/dotnet-symbol-service/SymbolService/appsettings.Development.json b/dotnet-symbol-service/SymbolService/appsettings.Development.json index fa8ce71..978bf88 100644 --- a/dotnet-symbol-service/SymbolService/appsettings.Development.json +++ b/dotnet-symbol-service/SymbolService/appsettings.Development.json @@ -1,10 +1,9 @@ { "Logging": { - "IncludeScopes": false, "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" } } -} +} \ No newline at end of file diff --git a/dotnet-symbol-service/SymbolService/appsettings.json b/dotnet-symbol-service/SymbolService/appsettings.json index 26bb0ac..93b64d3 100644 --- a/dotnet-symbol-service/SymbolService/appsettings.json +++ b/dotnet-symbol-service/SymbolService/appsettings.json @@ -1,15 +1,10 @@ { "Logging": { - "IncludeScopes": false, - "Debug": { - "LogLevel": { - "Default": "Warning" - } - }, - "Console": { - "LogLevel": { - "Default": "Warning" - } + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" } - } + }, + "AllowedHosts": "*" } diff --git a/dotnet-tracer/main/CodePulse.Bundle/License.rtf b/dotnet-tracer/main/CodePulse.Bundle/License.rtf index 2c5ba57..45b7638 100644 Binary files a/dotnet-tracer/main/CodePulse.Bundle/License.rtf and b/dotnet-tracer/main/CodePulse.Bundle/License.rtf differ diff --git a/dotnet-tracer/main/CodePulse.Installer.x64/License.rtf b/dotnet-tracer/main/CodePulse.Installer.x64/License.rtf index 2c5ba57..45b7638 100644 Binary files a/dotnet-tracer/main/CodePulse.Installer.x64/License.rtf and b/dotnet-tracer/main/CodePulse.Installer.x64/License.rtf differ diff --git a/dotnet-tracer/main/CodePulse.Installer/License.rtf b/dotnet-tracer/main/CodePulse.Installer/License.rtf index 2c5ba57..45b7638 100644 Binary files a/dotnet-tracer/main/CodePulse.Installer/License.rtf and b/dotnet-tracer/main/CodePulse.Installer/License.rtf differ diff --git a/hq/src/main/scala/com/secdec/bytefrog/hq/trace/players/LoopPlayer.scala b/hq/src/main/scala/com/secdec/bytefrog/hq/trace/players/LoopPlayer.scala index 49a1d55..7face25 100644 --- a/hq/src/main/scala/com/secdec/bytefrog/hq/trace/players/LoopPlayer.scala +++ b/hq/src/main/scala/com/secdec/bytefrog/hq/trace/players/LoopPlayer.scala @@ -29,5 +29,5 @@ trait LoopPlayer extends LoopingThread with StopControl with Cleanup { case _ => // for other cases, let the player itself override } - def cleanup = shutdown -} \ No newline at end of file + override def cleanup = shutdown +} diff --git a/installers/Scripts/text.ps1 b/installers/Scripts/text.ps1 index 4e59b65..c9e01c8 100644 --- a/installers/Scripts/text.ps1 +++ b/installers/Scripts/text.ps1 @@ -1,32 +1,72 @@ Set-PSDebug -Strict $ErrorActionPreference = 'Stop' +function Test-IsCore { + $PSVersionTable.PSEdition -eq 'Core' +} + +function Get-Bytes([string] $path) +{ + if (Test-IsCore) { + gc -AsByteStream -LiteralPath $path + } else { + gc -Encoding byte -LiteralPath $path + } +} + +function Get-LeadingBytes([string] $path, [int] $count) +{ + if (Test-IsCore) { + gc -AsByteStream -ReadCount $count -TotalCount $count -LiteralPath $path + } else { + gc -Encoding byte -ReadCount $count -TotalCount $count -LiteralPath $path + } +} + +function Get-TrailingBytes([string] $path, [int] $count) +{ + if (Test-IsCore) { + gc -AsByteStream -Tail $count -LiteralPath $path + } else { + gc -Encoding byte -Tail $count -LiteralPath $path + } +} + +function Get-ByteOrderMarker([string] $path) +{ + $leadingBytes = Get-LeadingBytes $path 4 + if ($leadingBytes -eq $null) { + $leadingBytes = @() + } + $leadingBytes +} + function Get-TextEncoding([string] $path) { - $leadingBytes = gc -Encoding byte -ReadCount 4 -TotalCount 4 -LiteralPath $path + $leadingBytes = Get-ByteOrderMarker $path if ($leadingBytes -eq $null) { $leadingBytes = @() } - $encoding = [Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding]::Ascii + $encoding = 'Ascii' if ($leadingBytes.length -ge 4 -and $leadingBytes[0] -eq 0 -and $leadingBytes[1] -eq 0 -and $leadingBytes[2] -eq 0xfe -and $leadingBytes[3] -eq 0xff) { - $encoding = [Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding]::UTF32 + $encoding = 'UTF32' } elseif ($leadingBytes.length -ge 2 -and $leadingBytes[0] -eq 0xfe -and $leadingBytes[1] -eq 0xff) { - $encoding = [Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding]::Unicode # UTF-16 + $encoding = 'Unicode' # UTF-16 } elseif ($leadingBytes.length -ge 3 -and $leadingBytes[0] -eq 0xef -and $leadingBytes[1] -eq 0xbb -and $leadingBytes[2] -eq 0xbf) { - $encoding = [Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding]::UTF8 + $encoding = 'UTF8' } $encoding } function Test-EndsWithCrLf([string] $path) { - $trailingBytes = gc -Encoding byte -Tail 2 -Path $path + $trailingBytes = Get-TrailingBytes $path 2 if ($trailingBytes -eq $null -or $trailingBytes.Length -ne 2) { return $false } @@ -41,7 +81,7 @@ function Set-TextContent([string] $path, [string[]] $text) $endsWithCrLfAfter = Test-EndsWithCrLf $path if (-not $endsWithCrLfBefore -and $endsWithCrLfAfter) { - $allBytes = gc -Encoding Byte -Path $path + $allBytes = Get-Bytes $path if ($allBytes.Length -lt 2) { return } diff --git a/installers/Windows/CodePulse.Installer.Win64/License.rtf b/installers/Windows/CodePulse.Installer.Win64/License.rtf index 2c5ba57..45b7638 100644 Binary files a/installers/Windows/CodePulse.Installer.Win64/License.rtf and b/installers/Windows/CodePulse.Installer.Win64/License.rtf differ diff --git a/installers/build.ps1 b/installers/build.ps1 index 185d9a8..08d42ed 100644 --- a/installers/build.ps1 +++ b/installers/build.ps1 @@ -16,13 +16,20 @@ param ( [switch] $useGitHubDotNetTracerWindowsDownloadUrl, [string] $version='1.0.0', [string] $versionForDotNetTracerWindowsDownloadUrl='1.0.0', - [string] $releaseDate=([DateTime]::Now.ToShortDateString()) + [string] $releaseDate=([DateTime]::Now.ToShortDateString()), + [switch] $skipDotNetCoreInstall ) Set-PSDebug -Strict $ErrorActionPreference = 'Stop' $VerbosePreference = 'Continue' +if (-not $skipDotNetCoreInstall) { + $file=([io.path]::gettemppath())+'.ps1' + Invoke-WebRequest -Uri 'https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.ps1' -OutFile $file + & $file -Channel 3.1 +} + $dotNetTracerWindowsDownloadUrl = "https://ci.appveyor.com/api/buildjobs/VERSION_NUMBER_FOR_DOWNLOAD/artifacts/installers/CodePulse-DotNetTracer-$version-Windows.zip" if ($useGitHubDotNetTracerWindowsDownloadUrl) { $dotNetTracerWindowsDownloadUrl = "https://github.com/codedx/codepulse/releases/download/vVERSION_NUMBER_FOR_DOWNLOAD/CodePulse-DotNetTracer-$version-Windows.zip" @@ -81,4 +88,4 @@ if (-not $skipLinux) { } } -Pop-Location \ No newline at end of file +Pop-Location diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 18d818b..9b3b4c2 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -80,7 +80,7 @@ object Dependencies { } // dependency-check - lazy val dependencyCheckCore = "org.owasp" % "dependency-check-core" % "5.2.0" + lazy val dependencyCheckCore = "org.owasp" % "dependency-check-core" % "6.0.3" // dispatch, Scala wrapper for Java AsyncHttpClient https://github.com/dispatch/reboot lazy val dispatch = "net.databinder.dispatch" %% "dispatch-core" % "0.11.4" diff --git a/project/Distributor.scala b/project/Distributor.scala index ea61237..32cad36 100644 --- a/project/Distributor.scala +++ b/project/Distributor.scala @@ -97,12 +97,12 @@ object Distributor extends BuildExtra { } - val jetty = Dependency("jetty", "9.4.7.v20170914", "http://central.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.7.v20170914/jetty-distribution-9.4.7.v20170914.zip") + val jetty = Dependency("jetty", "9.4.7.v20170914", "https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.7.v20170914/jetty-distribution-9.4.7.v20170914.zip") .extractAsZip { raw"^\Qjetty-distribution-9.4.7.v20170914\E/".r.replaceFirstIn(_, "") } .to { _ / "distrib-dependencies" / "common" / "jetty" } object tools { - val resourcer = Dependency("resourcer", "0.9", "https://dl.dropboxusercontent.com/s/zifogi9efgtsq1s/Anolis.Resourcer-0.9.zip?dl=1") // http://anolis.codeplex.com/downloads/get/81545 + val resourcer = Dependency("resourcer", "0.9", "https://github.com/codedx/codepulse/raw/master/tools/Anolis.Resourcer-0.9.zip") // from https://codeplexarchive.blob.core.windows.net/archive/projects/anolis/anolis.zip, releases/0/69c6e9d4-07aa-414b-9a5d-4a22572423d9 .extractAsZip { identity } .to { _ / "tools" / "resourcer" } } diff --git a/project/build.properties b/project/build.properties index 406a7d2..8e682c5 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.16 \ No newline at end of file +sbt.version=0.13.18 diff --git a/publish-symbol-service.ps1 b/publish-symbol-service.ps1 index 4f3be1e..24499e1 100644 --- a/publish-symbol-service.ps1 +++ b/publish-symbol-service.ps1 @@ -42,7 +42,7 @@ function Get-LastCommit([string] $sinceCommitHash) { function Invoke-Publish() { push-location 'dotnet-symbol-service' - dotnet publish -c Release -r (Get-OSRID) -o ..\..\dotnet-symbol-service\publish + dotnet publish -c Release -r (Get-OSRID) -o .\publish if ($LASTEXITCODE -ne 0) { write-error "Failed to publish with exit code $LASTEXITCODE" exit $LASTEXITCODE diff --git a/readme.md b/readme.md index 2be638a..6cd5cbe 100644 --- a/readme.md +++ b/readme.md @@ -25,30 +25,39 @@ Code Pulse is a real-time code coverage tool. It works by monitoring Java or .NE ## Development Environment Setup The following section describes steps necessary to build and run Code Pulse from source. If you want to download a pre-built version of Code Pulse to run, please visit our [releases](https://github.com/codedx/codepulse/releases) page for downloads. -* **Install .NET Core 2.1 SDK**. The 2.1 version of the SDK can be downloaded from the official Microsoft website at [https://www.microsoft.com/net/download](https://www.microsoft.com/net/download). -* **Enable .NET Framework 3.5 Windows feature**. To enable this feature: +Code Pulse lets you trace Java and .NET Framework applications. Use Windows to build a development environment that supports all Code Pulse features. If you are not interested in tracing .NET Framework applications, you can build a development environment on a different operating system by skipping the Windows-specific steps listed below. + +* **Install .NET Core 3.1 SDK**. The 3.1 version of the SDK can be downloaded from the official Microsoft website at [https://www.microsoft.com/net/download](https://www.microsoft.com/net/download). +* **[Windows Only] Enable .NET Framework 3.5 Windows feature**. To enable this feature: - Run "appwiz.cpl" from the run command or start menu. - Select the "Turn Windows features on or off" option. - In the Windows Features popup, find and select the ".NET Framework 3.5" feature. - Allow Windows to update the operating system as needed to complete the operation. -* **Install Windows SDK 10.0.16299.91**. This version of the Windows SDK can be downloaded from the official Microsoft website's SDK archives at [https://developer.microsoft.com/en-us/windows/downloads/sdk-archive](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive) -* **Install Visual Studio 2017, including the C++ workload**. The free community edition of Visual Studio 2017 is available at [https://visualstudio.microsoft.com/downloads/](https://visualstudio.microsoft.com/downloads/). When installing, select the .NET and C++ desktop development workloads. -* **Install Wix Toolset 3.11**. The 3.11 version of the Wix Toolset can be downloaded from the official Wix website at [http://wixtoolset.org/releases/](http://wixtoolset.org/releases/). -* **Install SBT 0.13.16**. The 0.13.16 version of SBT can be downloaded from the official SBT website at [https://www.scala-sbt.org/download.html](https://www.scala-sbt.org/download.html). -* **Install JDK 8.181**. The 8u181 version of the Java JDK can be downloaded from the official website at [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). +* **[Windows Only] Install Windows SDK 10.0.16299.91**. This version of the Windows SDK can be downloaded from the official Microsoft website's SDK archives at [https://developer.microsoft.com/en-us/windows/downloads/sdk-archive](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive) +* **[Windows Only] Install Visual Studio 2017, including the C++ workload**. The free community edition of Visual Studio is available at [https://visualstudio.microsoft.com/vs/older-downloads/](https://visualstudio.microsoft.com/vs/older-downloads/). When installing, select the .NET and C++ desktop development workloads. +* **[Windows Only] Install Wix Toolset 3.11**. The 3.11 version of the Wix Toolset can be downloaded from the official Wix website at [http://wixtoolset.org/releases/](http://wixtoolset.org/releases/). +* **Install SBT 0.13.18**. The 0.13.18 version of SBT can be downloaded from the official SBT website at [https://www.scala-sbt.org/download.html](https://www.scala-sbt.org/download.html). +* **Install AdoptOpenJDK OpenJ9 8**. The Java JDK can be downloaded from [https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=openj9](https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=openj9). - Create a "JAVA_HOME" environment variable. Set the value of this environment variable to the root location you installed the JDK to, such as "C:\Program Files\Java\jdk1.8.0_181". - Add to the PATH variable the value "%JAVA_HOME%\bin". -* **Install Git 2.19.0**. The 2.19.0 version of Git can be downloaded from the official Git website at [https://git-scm.com/downloads](https://git-scm.com/downloads) -* **Change Powershell script execution policy to allow local, unsigned scripts to run**. +* **Install Git**. Git can be downloaded from the official Git website at [https://git-scm.com/downloads](https://git-scm.com/downloads) +* **Install PowerShell Core**. Install PowerShell Core from [https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell). +* **[Windows Only] Change Powershell script execution policy to allow local, unsigned scripts to run**. - Start an elevated (administrator) command prompt. - - Run Powershell from this command prompt. + - Run pwsh from this command prompt. - Run the command "Set-ExecutionPolicy RemoteSigned" * **Acquire Code Pulse source**. Use your preferred Git client to download the Code Pulse source from [https://github.com/codedx/codepulse](https://github.com/codedx/codepulse). -* **Build Code Pulse**. Code Pulse can be built for installation or for development. - - To build Code Pulse for installation: from Powershell in the root Code Pulse directory that you git cloned to, run .\installers\build.ps1 with desired script parameter values to create packages for macOS, Linux, and Windows. You may provide the following switches to skip building for Linux, Mac, or Windows: "-skipLinux", "-skipMac", and "-skipWindows". Combine the switches as desired. For example: `.\installers\build.ps1 -version 2.5.0 -skipMac -skipLinux` +* **[Windows Only] Package Code Pulse**. Code Pulse uses Windows PowerShell to create Code Pulse releases for macOS, Linux, and Windows. + - To build Code Pulse for installation: from Windows Powershell in the root Code Pulse directory that you git cloned to, run .\installers\build.ps1 with desired script parameter values to create packages for macOS, Linux, and Windows. You may provide the following switches to skip building for Linux, Mac, or Windows: "-skipLinux", "-skipMac", and "-skipWindows". Combine the switches as desired. For example: `.\installers\build.ps1 -version 2.5.0 -skipMac -skipLinux` > Note: If you don't want to run Code Pulse from the development environment, you can use the installers created by build.ps1 to install and run Code Pulse. -* **Run Code Pulse from the Development Environment** To run in development mode, where you can use a web browser to run and debug Code Pulse: in a command prompt from the root Code Pulse directory that you git cloned to, enter the command "sbt". Once SBT loads, enter the command "container:start" to start an instance of Code Pulse. Browse via web browser to [localhost:8080](http://localhost:8080). When you are finished, enter the command "container:stop" to do a clean tear-down of Code Pulse. +* **Run Code Pulse from the Development Environment** - to run in development mode, where you can use a web browser to run and debug Code Pulse: + - Start a terminal/command prompt and switch to the Code Pulse root directory + - [Linux or macOS Only] Edit codepulse/src/main/resources/application.conf by switching systemSettings.symbolService.binary from "SymbolService.exe" to "SymbolService" + - Run the "sbt" command from the Code Pulse root directory + - Once sbt loads, enter the command "container:start" to start an instance of Code Pulse + - Browse via web browser to [localhost:8080](http://localhost:8080) + - When you are finished, enter the command "container:stop" to do a clean tear down of Code Pulse For more information, refer to the Code Pulse [User Guide](https://github.com/codedx/codepulse/wiki/user-guide). diff --git a/tools/Anolis.Resourcer-0.9.zip b/tools/Anolis.Resourcer-0.9.zip new file mode 100644 index 0000000..f4fc367 Binary files /dev/null and b/tools/Anolis.Resourcer-0.9.zip differ