Permalink
Browse files

[split] Add option for not building thrift from dependencies

This gives the user the option of extracting thrift files from
dependencies without building them, so they can be included in thrift
files in the current repo.

This is useful when the dependencies' thrift files were already built
with scrooge, when it would be redundant and a waste of time to rebuild
them upon extraction.

Signed-off-by: Moses Nakamura <mnakamura@twitter.com>

RB_ID=449089
  • Loading branch information...
1 parent d8fa6ce commit 025f95b08c23cf28f8dd0e7a3ded437d02902633 @DanielleSucher DanielleSucher committed with CI Sep 9, 2014
@@ -50,6 +50,8 @@ pom.xml file.
<dependencyIncludes>
<include>event-logger-thrift</include>
</dependencyIncludes>
+ <!-- tell scrooge to not to build the extracted thrift files (defaults to true) -->
+ <buildExtractedThrift>false</buildExtractedThrift>
</configuration>
<executions>
<execution>
@@ -71,14 +71,14 @@
private Set<File> thriftIncludes = new HashSet<File>();
/**
- * Which language the generated files should be ("experimental-java" or "scala")
- * @parameter default-value="scala"
+ * Which language the generated files should be ("experimental-java" or "scala")
+ * @parameter default-value="scala"
* {@code
* <configuration>
* <language>experimental-java</language>
* </configuration>
* }
- */
+ */
private String language;
/**
@@ -134,6 +134,17 @@
private Set<String> excludes = ImmutableSet.of();
/**
+ * Whether or not to build the thrift extracted from dependencies, if any
+ * @parameter
+ * {@code
+ * <configuration>
+ * <buildExtractedThrift>false</buildExtractedThrift>
+ * </configuration>
+ * }
+ */
+ private boolean buildExtractedThrift = true;
+
+ /**
* Whether or not to fix hashcode being default 0
* @parameter
*/
@@ -296,7 +307,7 @@ private long lastModified(Set<File> files) {
}
getLog().info("finding thrift files in dependencies");
extractFilesFromDependencies(findThriftDependencies(dependencyIncludes), getResourcesOutputDirectory());
- if (getResourcesOutputDirectory().exists()) {
+ if (buildExtractedThrift && getResourcesOutputDirectory().exists()) {
thriftFiles.addAll(findThriftFilesInDirectory(getResourcesOutputDirectory()));
}
getLog().info("finding thrift files in referenced (reactor) projects");

0 comments on commit 025f95b

Please sign in to comment.