[jira] [Commented] (OFBIZ-10145) Remove the Gradle wrapper from our release packages and add a step to our build notes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-10145) Remove the Gradle wrapper from our release packages and add a step to our build notes

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-10145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16858033#comment-16858033 ]

Jacques Le Roux commented on OFBIZ-10145:
-----------------------------------------

The work on Buildbot is done. I simply used {{wget}} to copy the Gradle Wrapper files from tools repo. We will now need to test with the Wrapper removed, should not be an issue, I used the -N wget parameter.

I finally thought about a Windows Powershell version of init-gradle-wrapper.sh, by using the wrapper files in tools to handle the init. So, alike in Buildbot, to get the wraper files I'll basically use something like:
{code:java}
if (! (Test-Path -Path ((Get-Item -Path ".\").FullName + "\gradle\"))) {
    Write-Host "Location seems to be incorrect, please run the 'sh gradle/init-gradle-wrapper.ps1' script from Apache OFBiz root.";
    exit
}

# This uses PowerShell Invoke-WebRequest command (aliased as wget here)
# https is not used because we don't want users to be asked for a credential (not sure about that, maybe https is OK)
wget -outf gradle\wrapper\gradle-wrapper.jar http://svn.apache.org/repos/asf/ofbiz/tools/Buildbot/Gradle/Wrapper/trunk/gradle-wrapper.jar
wget -outf gradle\wrapper\gradle-wrapper.properties http://svn.apache.org/repos/asf/ofbiz/tools/Buildbot/Gradle/Wrapper/trunk/gradle-wrapper.properties
{code}

[We can indeed easily load Gradle this way|https://docs.gradle.org/current/userguide/gradle_wrapper.html]:
bq. The Wrapper is a script that invokes a declared version of Gradle, downloading it beforehand if necessary.

I suggest we simplify init-gradle-wrapper.sh using the same idea. That's also what the Wrapper is for after all.

Of course when upgrading Gradle in trunk we will need to update the files in trunk tools repo. Only trunk because the Gradle version is freezed in releases branches.

I even thought about hacking the gradlew scripts, then we would not need init-gradle-wrapper at all. But those are generated with Gradle installation and better keep them as delivered by Gradle.

Here is the Powershell script: [^init-gradle-wrapper.ps1]

> Remove the Gradle wrapper from our release packages and add a step to our build notes
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-10145
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10145
>             Project: OFBiz
>          Issue Type: Task
>          Components: Gradle
>    Affects Versions: 17.12.01, 16.11.06, 18.12.01
>            Reporter: Jacques Le Roux
>            Assignee: Jacques Le Roux
>            Priority: Blocker
>             Fix For: 17.12.01
>
>         Attachments: OFBIZ-10145-gradlew.patch, init-gradle-wrapper-R16.sh, init-gradle-wrapper-trunk-and-18.sh, init-gradle-wrapper-trunk-and-18.sh, init-gradle-wrapper-trunk-and-18.sh, init-gradle-wrapper-trunk-and-18.sh, init-gradle-wrapper.ps1, init-gradle-wrapper.sh, init-gradle-wrapper.sh, init-gradle-wrapper.sh, init-gradle-wrapper.sh, init-gradle-wrapper.sh, init-gradlew-readme-R16.patch, init-gradlew-readme-R17.1.patch, init-gradlew-readme-R17.1.patch, init-gradlew-readme.patch, init-gradlew-readme.patch
>
>
> Following the discussion at http://markmail.org/message/nd7grfiyobjkfwae, considering LEGAL-288 and based on a lazy consensus on dev ML, we want to remove the gradle-wrapper.jar file from the next packaged releases and  use [~jacopoc]'s related proposition to document how to have Gradle working in the main README.md file.
> # Extract the archive file to your local directory.
> # Download gradle-wrapper.jar and place it in the OFBiz-root-dir/gradle/wrapper folder.
> I'm not sure if we should recommend a link to download the gradle-wrapper.jar. This might change in the future (versions, etc.), so indeed maybe simply asking to download is enough, cf  https://www.google.com/search?q=gradle-wrapper.jar+download&ie=UTF-8
> Also we need to add a point about removing gradle-wrapper.jar in https://cwiki.apache.org/confluence/display/OFBIZ/Release+Management+Guide+for+OFBiz



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)