For a university project, I need to perform profiling for a big project I am normally not affiliated with. I can download the project, import it into IntelliJ and edit the source code. However, I also need to instrument the code for some of its dependencies. They come in .jar
files, along with their source code, so I can browse it, but it is read-only. How can I change that?
What I have done so far: the library in question is listed both under Libraries tab, and Modules > "my module" > dependencies. I can choose copy as a module library
[I am not sure what this is meant to actually do] and save the files to a particular location. Inside the .jar
I get this way, reside both .class
and .java
files, so I can unzip it and grab the source files. But still, I need to somehow remove the dependency on .jar
and tell gradle
to instead compile and use the contents of this new directory.
The project in question is here and the dependency I want to edit is pulled in here. I don't have to use IntelliJ, it's just what I have experimented with so far.
This solution doesn't work - as you can see above, the import already comes in the compile 'x'
form, and still it's read-only. Other answers I found were just cases when a simple subclass would do, which is not the case for me.