Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Native image Jacoco demo #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Native image Jacoco demo #5

wants to merge 1 commit into from

Conversation

majavu
Copy link

@majavu majavu commented Dec 21, 2018

Example that shows how to get JaCoCo code coverage of GraalVM native images

@majavu majavu changed the title Example that shows how to get JaCoCo code coverage of GraalVM native … Native image Jacoco demo Dec 21, 2018
@@ -0,0 +1,32 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

This can't be the copyright for public examples.

graal_isolatethread_t * graal_isolate_thread;
graal_isolate_t * isolate;

/* Execute false branch within the invoked java method. */
Copy link
Member

Choose a reason for hiding this comment

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

the false branch

tear_down(graal_isolate_thread);
graal_tear_down_isolate(graal_isolate_thread);

/* Execute true branch within the invoked java method from another isolate. */
Copy link
Member

Choose a reason for hiding this comment

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

the true branch

classname: 'org.jacoco.ant.InstrumentTask',
classpath: configurations.jacoco.asPath)
ant.instrument(destdir: outputDir) {
fileset(dir: sourceSets.main.output.getClassesDirs().files.getAt(0))
Copy link
Member

Choose a reason for hiding this comment

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

This is ugly, can we use something better?

}
structure(name: 'Example') {
classfiles {
fileset(dir: sourceSets.main.output.getClassesDirs().files.getAt(0))
Copy link
Member

Choose a reason for hiding this comment

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

Same here. Can we use just sourceSets.main.output.getClassesDirs().files instead of the whole line.

@graalvmbot
Copy link
Collaborator

Hello majavu, thanks for contributing a PR to our project!

We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address maja -(dot)- vu255 -(at)- gmail -(dot)- com. You can sign it at that link.

If you think you've already signed it, please comment below and we'll check.

@graalvmbot
Copy link
Collaborator

Hello majavu, thanks for contributing a PR to our project!

We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address maja -(dot)- vu255 -(at)- gmail -(dot)- com. You can sign it at that link.

If you think you've already signed it, please comment below and we'll check.

@vjovanov
Copy link
Member

Can we merge this PR?

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

Successfully merging this pull request may close these issues.

3 participants