Skip to content

PEMessage/android-classpath-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

android-classpath-generator

This repo is intended for users who are having trouble getting Android projects to work with JDTLS. Thanksfully init.gradle come from JDTLS could also work standalone, only need some minor tweaks.

classpathgen.sh

Usage:

./gradlew -I init.gradle eclipse

or

./classpathgen.sh

To update the init.gradle file:

./classpathgen.sh -u

After generate classpath, disable JDTLS update classpath(always do it manually by ourself)

init_options = {
    settings = {
        java = {
            import = {
                gradle = {
                    -- See: https://www.reddit.com/r/neovim/comments/1m3v9kk/jdtls_keeps_regenerating_my_classpath_for_a/
                    -- do not let jdtls generate .classpath, manually generate it
                    enabled = false,
                },
            },
        },
    },
},

and clean cache if you need

rm ~/.cache/jdtls/workspace/.metadata -rf  

now android project should work well with jdtls

Also See

vim-android This awesome vim-android plugin use similiar apporach, but do not rely on eclipse plugin. but generate metadata directly from android plugin. and manually create .classpath. ./gradlew -I init.gradle vim this inspire me maybe jdtls using same way to do this, and turn out to be true.

About

Generate .classpath for android gradle project for JDTLS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages