Skip to content

Instantly share code, notes, and snippets.

@disc99
Last active January 9, 2017 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save disc99/8a585f7aced4643df813eb40c2c00d52 to your computer and use it in GitHub Desktop.
Save disc99/8a585f7aced4643df813eb40c2c00d52 to your computer and use it in GitHub Desktop.

IntelliJ + gradle + annotation processor の設定方法

  • build.gradeに生成されたクラスをIntelliJで読み込む為の設定
apply plugin: 'java'
apply plugin: 'idea'

repositories {
	maven {
		url "http://dl.bintray.com/disc99/maven"
	}
}

dependencies {
	compile 'io.disc99.kuroko:annotation:0.1.1'
	compileOnly 'io.disc99.kuroko:processor:0.1.1'
}

idea {
	module {
		// add annotation peocessor generated classes on classpath for idea
		sourceDirs += file('build/classes/main/generated')
		generatedSourceDirs += file('build/classes/main/generated')
	}
}
  • IntelliJでannotation processor の有効化

IntelliJ IDEA > Preferences... > Annotation Processors > Check Enable annotation processing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment