Remove incorrect assumption that output will be in folder named classes

When running in Eclipse, by default Gradle builds its output into a
folder named bin. This commit update the annotation processor to remove
the failure assumption that the output will always be located beneath
a folder named classes.

Closes gh-2369
See gh-2361
pull/2391/head
Kris De Volder 10 years ago committed by Andy Wilkinson
parent 0025be8771
commit 65acaf885b

@ -1,5 +1,5 @@
/*
* Copyright 2012-2014 the original author or authors.
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -393,9 +393,11 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
// Gradle keeps things separate
String path = file.getPath();
int index = path.lastIndexOf(CLASSES_FOLDER);
path = path.substring(0, index) + RESOURCES_FOLDER
+ path.substring(index + CLASSES_FOLDER.length());
file = new File(path);
if (index >= 0) {
path = path.substring(0, index) + RESOURCES_FOLDER
+ path.substring(index + CLASSES_FOLDER.length());
file = new File(path);
}
}
return (file.exists() ? new FileInputStream(file) : fileObject.toUri().toURL()
.openStream());

Loading…
Cancel
Save