Giter VIP home page Giter VIP logo

cake.gradle's Introduction

Cake.Gradle

standard-readme compliant Build Codecov Report NuGet package All Contributors

Aliases to assist with running Gradle builds from Cake build scripts.

Table of Contents

Install

#addin nuget:?package=Cake.Gradle

Additionally, either gradle has to be installed on the system or the project needs a gradle-wrapper (gradlew)

Usage

 #addin nuget:?package=Cake.Gradle

// Run 'gradle --version'
Task("Gradle-Version")
    .Does(() =>
{
    Gradle.WithArguments("--version").Run();
});

// Run 'gradle hello' in a specific folder
// Note: if you have a gradle wrapper setup in the specified path, this one will be used
Task("Gradle-Hello")
    .Does(() =>
{
    Gradle.FromPath("./example").WithTask("hello").Run();
});


// Run 'gradle hello' in a specific folder with default log level
// Note: if no log level is set, it is derived from the Cake verbosity (which is set to 'verbose' in build.ps1)
Task("Gradle-Hello-WithDefaultLogLevel")
    .Does(() =>
{
    Gradle.FromPath("./example").WithTask("hello").WithLogLevel(GradleLogLevel.Default).Run(); 
});

// Run 'gradle --offline --build-file build.gradle hello' in a specific folder
Task("Gradle-Hello-WithArguments")
    .Does(() =>
{
    Gradle.FromPath("./example").WithTask("hello").WithArguments("--offline --build-file build.gradle").Run();
});

Compatibility

Cake 0.33.0 and later.

Motivation

Allow Cake users to orchestrate a complex build including a Gradle-based Java build. Works similar to the cake-gulp addin.

A Word of caution

Cake and Gradle are both task runners. I consider it bad practice to call one task runner out of another. It would be better to only have one tool per concern (i.e. task running) - but sometimes this is not feasible.

Discussion

For questions and to discuss ideas & feature requests, use the GitHub discussions on the Cake GitHub repository, under the Extension Q&A category.

Join in the discussion on the Cake repository

Maintainer

Nils Andresen @nils-a

Contributing

Cake.Gradle follows the Contributor Covenant Code of Conduct.

We accept Pull Requests. Please see the contributing file for how to contribute to Cake.Gradle.

Small note: If editing the Readme, please conform to the standard-readme specification.

This project follows the all-contributors specification. Contributions of any kind welcome!

Contributors

Thanks goes to these wonderful people (emoji key):


Christian Abegg

๐Ÿ’ป

Nils Andresen

๐Ÿ’ป

License

MIT License ยฉ Christian Abegg, Nils Andresen

Cake.Gradle includes third-party code which is licensed under its own respective license.

LitJSON

License: Unlicense, https://github.com/LitJSON/litjson/blob/develop/COPYING

cake.gradle's People

Contributors

abeggchr avatar dependabot[bot] avatar gep13 avatar github-actions[bot] avatar jericho avatar jessejiang0214 avatar juergenrb avatar nils-a avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cake.gradle's Issues

Add cake-addin tag to Cake.Gradle 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-addin in the NuGet package of this addin, so that the NuGet Gallery can display the correct instructions to install this addin.

The UI will look similar to this:

image

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

Updating to latest Cake Release

@abeggchr are you still in a position to maintain this addin?

During the recent audit, it was found that this addin is targetting 0.15.0 of Cake (which is quite a few releases behind). If you are no longer in a position to maintain this addin, would you be interested in moving it to the Cake-Contrib Organisation, where it could be opened up to the Community?

Replace Gitter with GitHub Discussions

The Discussion platform for Cake-Contrib has been moved from Gitter to GitHub Discussion (see cake-build/website#1470).
Please check this repo for references to Gitte and replace them accordingly.

Search suggests that references could be in

  • docs/input/_Bottom.cshtml

Some tests are needed

Currently the coverage is around 73% and GradleRunnerAlias.cs is not covered at all.

Add a possibility to pass project properties more easy

Currently to pass properties, the syntax is something like:

Gradle
        .FromPath(BuildParameters.SourceDirectoryPath)
        .WithTask("buildPlugin")
        .WithArguments($"-PpluginVersion=\"{buildVersion.SemVersion}\"")
        .Run(); 

it would be much more easy and readable to have something like:

Gradle
        .FromPath(BuildParameters.SourceDirectoryPath)
        .WithTask("buildPlugin")
        .WithProperty("pluginVersion", buildVersion.SemVersion)
        .Run(); 

Would it be possible to use the Cake Contrib Icon for your NuGet Package?

Thanks again for creating this Cake Addin, we really appreciate the effort that you have put in to creating it.

We, the Cake Team, recently announced a new Cake Contrib Icon, details of which can be found here:

http://cakebuild.net/blog/2017/06/new-cake-contrib-icon

Would you consider changing the nuspec file for your NuGet Package to use this new Cake Contrib Icon? If so, the recommended URL to use is:

https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png

Details of the above URL can be found in the repository here:

https://github.com/cake-contrib/graphics

Please let me know if you have any questions.

Support gradle wrapper

A gradle wrapper (the gradlew.bat /gradlew file in the /example) directory is not used but only the gradle.bat/gradle from the PATH.

Expected behavior: use the wrapper from the project directory if available.

readme is outdated

  • compatibility is outdated
  • usage does not show nuget, but a local reference

CodeQL stopped working

virtual environment is not pinned.

Also, there was a warning before the error started:

1 issue was detected with this workflow: git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.

Rename repository

Before setting up a new AppVeyor project for this repository, I think we should take the opportunity to rename the repository so that it is consistent with others in this Organisation.

i.e. suggesting we change:

cake-gradle

to

Cake.Gradle

Neither codecov, nor coveralls show coverage.

  • (codecov)[https://codecov.io/gh/cake-contrib/Cake.Gradle] shows nothing (though commits are listed), clicking on a commit shows There was an error processing coverage reports.
  • (coveralls)[https://coveralls.io/github/cake-contrib/cake-gradle] shows %0 coverage. As with codecov, the builds are listed but the report seemingly contains no data.

When supplying secret parameters to gradle they should be kept secret

I.e. When setting a deployment token for the JetBrains Marketplace the syntax is

-Dorg.gradle.project.intellijPublishToken=YOUR_HUB_TOKEN_HERE

however the token should not be visible in the logs.

Something like

.WithSystemProperty("org.gradle.project.intellijPublishToken", "YOUR_HUB_TOKEN_HERE", true)

where the last part (true) would mean that the token should be secret would be good.

Calling `WithArguments` twice will override the first call.

running Gradle like:

Gradle
    .WithArguments("-PpluginVersion=\"3.2.1\"")
    .WithArguments("-Dorg.gradle.project.intellijPublishToken=\"YOUR_HUB_TOKEN_HERE\"")
    .Run();

Should result in one arguement line like -PpluginVersion="3.2.1" -Dorg.gradle.project.intellijPublishToken="YOUR_HUB_TOKEN_HERE" but instead it will only show the last argument.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

Update Cake.Gradle README: Add link to GitHub Discussions

We've been using GitHub Discussions as the preferred communication channel (instead of Gitter) because it makes it easier to keep track of discussions in a structured way, especially if multiple discussions are happening at the same time. It also allows to search for previous questions/answers, which can be a helpful resource.

As such, we're recommending addin maintainers to mention the GitHub discussion in their README and update links to Gitter (if any) to point to the GH discussions.

image

Template:

## Discussion

For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/cake-build/cake/discussions/categories/extension-q-a) category.

[![Join in the discussion on the Cake repository](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/cake-build/cake/discussions)

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:

  • We were unable to determine what version of Cake.Core your addin is referencing. Please make sure you are referencing 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.

Execute a gradle buildfile without installation

Current situation:

  • Either Gradle has to be installed on the system or the project needs a Gradle wrapper (gradlew)

Acceptance criteria:

  • No installation or Gradle wrapper is required
  • Cake loads Gradle to the /tools/ folder and uses this version

But:

  • How to specify the version

cake-contrib user on NuGet

First of all, I wanted to thank you for adding to the Cake community by adding this addin.

I was just wondering if you had seen this blog post:

http://cakebuild.net/blog/2016/08/cake-contribution-organization

We are currently going through a process of increasing the visibility of addins, and also trying to ensure their long term maintainability.

To that end, we are asking addin creators to add the cake-contrib user on NuGet as a co-owner (this can be done through the NuGet website by clicking on Manage Owners on the package page).

Would you be interested in doing this for Cake.AWS.CloudFront? If you have any questions about this, please let me know. There was some initial concern that the Cake Team were trying to "take over" packages, and that couldn't be further from the truth, and if you have this concern, or others, I would like to address them.

Thanks!

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.