Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
0fa3842a
Commit
0fa3842a
authored
Mar 29, 2019
by
Ahmed Ashour
Committed by
skylot
Mar 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: warn about compiler not found (PR #540)
parent
6fc7c7a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
StaticCompiler.java
...src/test/java/jadx/tests/api/compiler/StaticCompiler.java
+12
-9
No files found.
jadx-core/src/test/java/jadx/tests/api/compiler/StaticCompiler.java
View file @
0fa3842a
package
jadx
.
tests
.
api
.
compiler
;
import
javax.tools.FileObject
;
import
javax.tools.ForwardingJavaFileManager
;
import
javax.tools.JavaCompiler
;
import
javax.tools.JavaFileObject
;
import
javax.tools.SimpleJavaFileObject
;
import
javax.tools.StandardJavaFileManager
;
import
javax.tools.ToolProvider
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
...
...
@@ -16,9 +9,16 @@ import java.util.Arrays;
import
java.util.Collections
;
import
java.util.List
;
import
jadx.core.utils.files.FileUtils
;
import
javax.tools.FileObject
;
import
javax.tools.ForwardingJavaFileManager
;
import
javax.tools.JavaCompiler
;
import
javax.tools.JavaCompiler.CompilationTask
;
import
javax.tools.JavaFileObject
;
import
javax.tools.SimpleJavaFileObject
;
import
javax.tools.StandardJavaFileManager
;
import
javax.tools.ToolProvider
;
import
static
javax
.
tools
.
JavaCompiler
.
CompilationTask
;
import
jadx.core.utils.files.FileUtils
;
public
class
StaticCompiler
{
...
...
@@ -27,6 +27,9 @@ public class StaticCompiler {
public
static
List
<
File
>
compile
(
List
<
File
>
files
,
File
outDir
,
boolean
includeDebugInfo
)
throws
IOException
{
JavaCompiler
compiler
=
ToolProvider
.
getSystemJavaCompiler
();
if
(
compiler
==
null
)
{
throw
new
IllegalStateException
(
"Can not find compiler, please use JDK instead"
);
}
StandardJavaFileManager
fileManager
=
compiler
.
getStandardFileManager
(
null
,
null
,
null
);
Iterable
<?
extends
JavaFileObject
>
compilationUnits
=
fileManager
.
getJavaFileObjectsFromFiles
(
files
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment