Git Product home page Git Product logo

cake.longpath.module's Introduction

Cake LongPath Module

Cake Module that adds long path support to build scripts running on Windows using Pri.LongPath

This module replaces the default IFileSystem with one that uses Pri.LongPath to give long path support. This is an early alpha version, so still pre-release and made avail for testing purposes.

Installation

Pre-compiled binaries are available on NuGet package id Cake.LongPath.Module, Cake modules are automatically loaded based on the tools/modules folder relative to the Cake script being executed.

  1. Create folder tools\modules
  2. Install Cake.LongPath.Module from nuget
nuget.exe install Cake.LongPath.Module -PreRelease -ExcludeVersion -OutputDirectory "tools\modules" -Source https://www.nuget.org/api/v2/
  1. Next time you execute your build script the new module should be loaded.

Folder structure after installation should look something like this

|   build.cake
\---tools
    +---Cake
    |       Cake.exe
    |       ...
    |
    \---modules
        \---Cake.LongPath.Module
                Cake.LongPath.Module.dll
                ...

You can find an minimal example of module installation script in moduleusageexample/build.cmd, that should output something like below if everything works:

Sucessfully loaded [path to moduleusageexample]\tools\modules\Cake.LongPath.Module\Cake.LongPath.Module.dll
IFileSystem: Cake.LongPath.Module.LongPathFileSystem
        IFile: Cake.LongPath.Module.LongPathFile
        IDirectory: Cake.LongPath.Module.LongPathFile

Test

The project is setup to debug using moduletest/test.cake, you can also execute it from the command-line using moduletest/test.cmd.

cake.longpath.module's People

Contributors

azchohfi avatar devlead avatar kcamp avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cake.longpath.module's Issues

Recommended changes resulting from automated audit

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • You are currently referencing Cake.Core 0.26.0. Please upgrade to 0.28.0
  • The Cake.Core reference should be private. Specifically, your addin's .csproj should have a line similar to this: <PackageReference Include="Cake.Core" Version="0.28.0" PrivateAssets="All" />
  • Your addin should target netstandard2.0. Please note that there is no need to multi-target, netstandard2.0 is sufficient.
  • There should be a YAML file describing your addin on the cake web site. Specifically, you should add a .yml file in this repo

Apologies if this is already being worked on, or if there are existing open issues, this issue was created based on what is currently published for this package on NuGet.org and in the project on github.

Not working with UNC paths

Hello.

If I use the module Cake.LongPath.Module in my cake scripts, I am not able to use UNC paths. For example:

CleanDirectory(deployDirectory);
// OR
CopyFiles(deployFiles, deployDirectory);

produce an exception

An error occurred when executing task '_deployWeb'.
Error: System.AggregateException: Mindestens ein Fehler ist aufgetreten. ---> System.IO.IOException: Der Vorgang wurde erfolgreich beendet.

   bei Pri.LongPath.Common.ThrowIOError(Int32 errorCode, String maybeFullPath)
   bei Pri.LongPath.FileSystemInfo.Refresh()
   bei Pri.LongPath.DirectoryInfo.get_Exists()
   bei Cake.Common.IO.DirectoryCleaner.Clean(ICakeContext context, DirectoryPath path, Func`2 predicate)
   bei Cake.Common.IO.DirectoryAliases.CleanDirectory(ICakeContext context, DirectoryPath path)
   bei Submission#0.CleanDirectory(DirectoryPath path)
   bei Submission#0.<<Initialize>>b__0_14()
   bei Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass20_0.<Does>b__0(ICakeContext x)
   bei Cake.Core.CakeTask.<Execute>d__43.MoveNext()

Without the module, the same works fine.

Add cake-module tag to Cake.LongPath.Module NuGet package

The NuGet Gallery will soon include a "Cake" tab with instructions on how to use NuGet packages in Cake build scripts. I'd like to suggest that you include the tag cake-module in the NuGet package of this module, so that the NuGet Gallery can display the correct instructions to install this module.

The UI will look similar to this:

image

Documentation on best practices on tags for Cake modules: https://cakebuild.net/docs/extending/modules/best-practices#tags

Convert this repo to use Cake.Recipe

@devlead I am pretty much at the point where my not so secret project, Cake.Recipe, is ready to be rolled out.

Would you be interested in me adding it to this repository?

The benefits would be...

  • a single place to control all the builds in the cake-contrib organisation
  • access to notifications on twitter and gitter when new releases are available

Things that Cake.Recipe already does:

  • Version with GitVersion
  • Build
  • Compile
  • Run Unit Tests
  • Submit results to coveralls.io
  • NuGet Package everything
  • Upload all artifacts to AppVeyor
  • Runs DupFinder
  • Runs InspectCode
  • Handles publishing to both MyGet and NuGet (for interim releases)
  • Runs GitLink, meaning that addin code is debuggable doing debug session in visual studio when debugging build.cake
  • Documentation Website generation using Wyam

Probably other stuff that I have forgotten.

The main thing being, if we add something to Cake.Recipe, then all projects that are already using Cake.Recipe should be able to immediately take advantage of it.

Thoughts? If you were interested, would you be happy to have me make the changes directly to repo, or would you prefer it as a PR?

update to Cake 0.26

Got this error:

Error: The assembly 'Cake.LongPath.Module, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.22.0).
This assembly need to reference at least Cake.Core version 0.26.0.
Another option is to downgrade Cake to an earlier version.
It's not recommended, but you can explicitly opt-out of assembly verification
by configuring the Skip Verification setting to true
(i.e. command line parameter "--settings_skipverification=true",
environment variable "CAKE_SETTINGS_SKIPVERIFICATION=true",
read more about configuration at https://cakebuild.net/docs/fundamentals/configuration)


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.