Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate build system to Gradle #469

Merged
merged 7 commits into from Aug 2, 2019
Merged

Migrate build system to Gradle #469

merged 7 commits into from Aug 2, 2019

Conversation

vlsi
Copy link
Collaborator

@vlsi vlsi commented Jun 17, 2019

This is revival of #448

Note: below tricks might help to hide file movements:
A) GitHub UI: scroll the diff ("files changed") to the very end, and type the following to the browser console: $$('div.empty').forEach(function(e) { e.parentElement.parentElement.style.display='none'; })

B) You can watch individual commits (e.g. open Commits ) and review individual ones

C) You can use git log -M30% -l0 --stat -p -G. on the command line to show non-trivial diffs only (hide movements)

D) You can use git diff -M30% -l0 --stat -p -G. origin/master to see the full diff

Note GitHub has a limit on the number of renamed files, so sometimes it shows a file as "deleted and inserted" even if that was a simple rename.

-l0 can be used to set "unlimited" number of "renamed files" in git diff / git log.

Then the diff shows 152 files changed, 5046 insertions(+), 10204 deletions(-).

Note: license verification, IDE configuration, and release plugin is moved to https://github.com/vlsi/vlsi-release-plugins.
It reduces JMeter build scripts by ~1500 lines, and it improves build time (pre-built plugins are reused instead of building it from source).

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 17, 2019

Dependency with "manual" license configuration: dnsjava/dnsjava#63

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 17, 2019

Dependency with "manual" license configuration: oblac/jodd#717

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 17, 2019

Dependency with "manual" license configuration: bulenkov/Darcula#53

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 17, 2019

Dependency with "manual" license configuration: json-path/JsonPath#550

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 17, 2019

Dependency with "manual" license configuration: bobbylight/RSyntaxTextArea#299

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 17, 2019

Dependency with "manual" license configuration: x-stream/xstream#151

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 17, 2019

Dependency with "manual" license configuration: google/brotli#758

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 17, 2019

Dependency with "manual" license configuration: ben-manes/caffeine#325

Copy link
Contributor

@pmouawad pmouawad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @vlsi ,
First, thanks for this big piece of work, volume of work is pretty big !

I made a first review, I didn't expect migration from Ant to Gradle would lead to so much code to be frank.
As of me, for now I don't feel comfortable maintaining this new code but I guess it will come.
Anyway, maybe it would help a bit to create or update doc with something like:

  • Old Ant feature => Location / classes in Gradle
    Example:
  • ApacheJMeter_parent.xml => Location where it is generated
    ...

Thanks

build.gradle.kts Outdated Show resolved Hide resolved
* limitations under the License.
*
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for maintenance and Gradle newbies, add a header comment explaining aim of the file ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought "gradle buildsrc" Google search answers those kind of questions.
Do you still think it is worth clarifying?

src/build.gradle.kts Outdated Show resolved Hide resolved
@vlsi
Copy link
Collaborator Author

vlsi commented Jun 23, 2019

Anyway, maybe it would help a bit to create or update doc with something like:

@pmouawad , have you seen https://github.com/apache/jmeter/blob/1a70d90e71b00d813ad0735ee9063c4f9e1f0808/gradle.md ?
I think it covers all of the use cases.
If you think something is missing, feel free to comment.

However, I do not think we really need a dictionary that maps "old Ant feature" to "Gradle feature".

99% of the times one would be fine with just trying gw tasks (./gradlew tasks) to see the possible tasks, and 100% of the times, the output is placed into build/ folder. So one can just open build/ folder and find the content there as required.

@vlsi vlsi force-pushed the gradle branch 3 times, most recently from a5ad14f to 97e0d24 Compare June 28, 2019 20:25
@vlsi vlsi changed the title WIP: Migrate build system to Gradle Migrate build system to Gradle Jun 28, 2019
@codecov-io
Copy link

codecov-io commented Jul 1, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@bb89778). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #469   +/-   ##
=========================================
  Coverage          ?   53.53%           
  Complexity        ?     9389           
=========================================
  Files             ?     1008           
  Lines             ?    61671           
  Branches          ?     6913           
=========================================
  Hits              ?    33013           
  Misses            ?    26260           
  Partials          ?     2398
Impacted Files Coverage Δ Complexity Δ
...ache/jmeter/modifiers/BSFPreProcessorBeanInfo.java 100% <ø> (ø) 1 <0> (?)
.../apache/jmeter/modifiers/gui/CounterConfigGui.java 73.01% <ø> (ø) 7 <0> (?)
...va/org/apache/jmeter/visualizers/utils/Colors.java 50% <ø> (ø) 3 <0> (?)
...ava/org/apache/jmeter/assertions/XMLAssertion.java 59.25% <ø> (ø) 3 <0> (?)
...ava/org/apache/jmeter/extractor/HtmlExtractor.java 86.23% <ø> (ø) 41 <0> (?)
...jmeter/timers/ConstantThroughputTimerBeanInfo.java 100% <ø> (ø) 1 <0> (?)
.../jmeter/visualizers/XMLDefaultMutableTreeNode.java 6.66% <ø> (ø) 2 <0> (?)
...ache/jmeter/timers/gui/AbstractRandomTimerGui.java 87.23% <ø> (ø) 5 <0> (?)
...n/java/org/apache/jmeter/visualizers/BarGraph.java 50% <ø> (ø) 3 <0> (?)
...rg/apache/jmeter/visualizers/TreeNodeRenderer.java 66.66% <ø> (ø) 3 <0> (?)
... and 190 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb89778...fac1ca7. Read the comment docs.

@frschwab
Copy link
Contributor

frschwab commented Jul 25, 2019

Hi, I only get the follwing tasks shown after checking out your repo:

gw tasks

Build Setup tasks
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

gw runGui doesn't show up nor work.
How to build the project?

@vlsi
Copy link
Collaborator Author

vlsi commented Jul 26, 2019

@frschwab , you have to be using gradle branch.

For instance:

git clone -b gradle https://github.com/vlsi/jmeter.git jmeter_vlsi
cd jmeter_vlsi
gw tasks

@frschwab
Copy link
Contributor

@frschwab , you have to be using gradle branch.

For instance:

git clone -b gradle https://github.com/vlsi/jmeter.git jmeter_vlsi
cd jmeter_vlsi
gw tasks

I checked it out. I ran gw init and gw wrapper and gw eclipse.
I imported gradle project into eclipse 2019.6.
I also merged from apache master branch.

This is the errors i get in eclipse:
image

@vlsi
Copy link
Collaborator Author

vlsi commented Jul 29, 2019

I also merged from apache master branch.

Why?

@frschwab
Copy link
Contributor

I also merged from apache master branch.

Why?

I thought I could get rid of the error messages. But I get the exact same messages if I do not merge apache master branch into vlsi gradle - I just tried it out again.

@vlsi
Copy link
Collaborator Author

vlsi commented Jul 29, 2019

I have rebased the branch, moved engine.report... to to the appropriate folder, and made jmeterversion genration task is invoked by Eclipse on project import.

Please retry.

I don't use Eclipse, however I tried to import the project, and it works for me.

@vlsi
Copy link
Collaborator Author

vlsi commented Jul 30, 2019

Dependency with "manual" license configuration: eXparity/hamcrest-date#26

@vlsi
Copy link
Collaborator Author

vlsi commented Jul 30, 2019

Dependency with "manual" license configuration: hamcrest/JavaHamcrest#264

@vlsi vlsi force-pushed the gradle branch 4 times, most recently from 3aa2763 to 46a9013 Compare July 30, 2019 16:05
@frschwab
Copy link
Contributor

One final thing from my side:
I don't know if that is possible or best practice in Gradle, but I think it would be user friendly if gw tasks showed only the main tasks that are used most of the time, and something like gw tasks --all showed them all (like currently) or gw tasks --testing for example showed only all tasks in the testing topic.
Otherwise, you really have to scroll up a lot on the console ;-)
Thanks for your work, also on how-to integrate into eclipse!

@vlsi
Copy link
Collaborator Author

vlsi commented Jul 31, 2019

I don't know if that is possible or best practice in Gradle, but I think it would be user friendly if gw tasks showed only the main tasks

It is funny I was thinking behind exactly those lines, and I have already hidden a couple of tasks:
vlsi/vlsi-release-plugins@bd91637

It is kind of hard to tell what are those "main" tasks.
It would be nice if you could go through the list of tasks and classify them.

Frankly speaking, I don't like Gradle's verbosity on generateMetadataFileForCorePublication / generatePomFileForCorePublication / publishCorePublicationToMavenLocal / publishCorePublicationToNexusRepository
It looks like those tasks are the most offenders.

I would try to hide those, and replace with something like "generatePom".
For instance, currently we have "test - Runs the unit tests" task which is printed just once even though the task exists in logs of subprojects.

gw tasks --testing

Do you refer to batch test tasks?
Hiding those under --testing flag indeed makes sense.
Thanks. That is nice.

@frschwab
Copy link
Contributor

frschwab commented Jul 31, 2019

It would be nice if you could go through the list of tasks and classify them.

I can try to find some time in the next days.

Frankly speaking, I don't like Gradle's verbosity on generateMetadataFileForCorePublication / generatePomFileForCorePublication / publishCorePublicationToMavenLocal / publishCorePublicationToNexusRepository
It looks like those tasks are the most offenders.

I just found out that e.g. gw runG also works and it executes runGui task. Though it doesn't do autocomplete on the command line itself ;-)

gw tasks --testing

Do you refer to batch test tasks?
Hiding those under --testing flag indeed makes sense.
Thanks. That is nice.

Yes, I thought about the long list of batch tests in the first section.
That was just an example pseudo code, a more precise name would make more sense, not to be confused with gw test

Also seems like these sections are getting ordered alphabetically, which is maybe not the same order in which someone would call these tasks.

@vlsi
Copy link
Collaborator Author

vlsi commented Jul 31, 2019

Also seems like these sections are getting ordered alphabetically, which is maybe not the same order in which someone would call these tasks.

I've created gradle/gradle#10133

@vlsi vlsi force-pushed the gradle branch 4 times, most recently from 23ddb0a to 4dd6da3 Compare August 2, 2019 11:41
@vlsi vlsi merged commit 2be94e8 into apache:master Aug 2, 2019
@vlsi vlsi mentioned this pull request Sep 16, 2019
4 tasks
@vlsi
Copy link
Collaborator Author

vlsi commented Feb 14, 2020

Dependency with "manual" license configuration: weisJ/darklaf#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants