Skip to content

Commit

Permalink
Simply exclude module descriptor from Eclipse compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
A248 committed Apr 29, 2021
1 parent aaf0cdc commit 8cfa196
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
10 changes: 2 additions & 8 deletions caffeine/build.gradle
Expand Up @@ -31,15 +31,9 @@ eclipse.classpath {
entries.findAll {
it instanceof SourceFolder && it.output == 'bin/codeGen'
}*.output = 'bin/main'
entries.findAll { it instanceof AbstractClasspathEntry }.each {
it.entryAttributes['module'] = 'true'
}
def modules = [ 'java.compiler', 'java.logging', 'jdk.unsupported',
'com.google.common', 'com.google.googlejavaformat', 'guava.testlib',
'it.unimi.dsi.fastutil', 'org.apache.commons.lang3', 'org.cache2k.api',
'org.hamcrest', 'org.jctools.core', 'org.mockito', 'org.testng' ]
// Exclude module-info when compiling through Eclipse
def main = entries.find { it instanceof SourceFolder && it.path == 'src/main/java' }
main.entryAttributes['add-reads'] = buildAddReads('com.github.benmanes.caffeine', modules)
main.excludes.add('module-info.java')
}
}
}
Expand Down
15 changes: 1 addition & 14 deletions gradle/eclipse.gradle
Expand Up @@ -47,17 +47,4 @@ def ignoreDerivedResources(projectDescription, directories = [
}
}
}
}

ext.buildAddReads = { subjectModule, addModules ->
def addReads = new StringBuilder()
addModules.each {
if (addReads.length() != 0) {
addReads.append(':')
}
addReads.append(subjectModule)
addReads.append('=')
addReads.append(it)
}
return addReads.toString()
}
}

0 comments on commit 8cfa196

Please sign in to comment.