forked from linkedin/rest.li
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix failed test TestRestSpecAnnotation.
Refactor build scripts to export global variables. Add LICENSE header to build scripts. RB=108595 R=adubman,jbetz,jwalker,sihde,si-dev A=jbetz,sihde
- Loading branch information
Keren Jin
committed
Nov 30, 2012
1 parent
e9e17cb
commit 0bedafc
Showing
16 changed files
with
188 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
File getGeneratedSourceDir(Project project, SourceSet sourceSet, String genType) | ||
{ | ||
return project.file("src${File.separatorChar}${sourceSet.name}Generated${genType}") | ||
} | ||
/* | ||
Copyright (c) 2012 LinkedIn Corp. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
project.sourceSets.all { SourceSet sourceSet -> | ||
final Task cleanGeneratedDirTask = project.task(sourceSet.getTaskName('clean', 'GeneratedDir')) << { | ||
project.delete(getGeneratedSourceDir(project, sourceSet, 'DataTemplate')) | ||
project.delete(getGeneratedSourceDir(project, sourceSet, 'Rest')) | ||
project.delete(getGeneratedSourceDir(project, sourceSet, 'AvroSchema')) | ||
project.delete(project.file(rootProject.ext.build.getDataTemplateOutDirPath(project, sourceSet)).parentFile) | ||
project.delete(project.file(rootProject.ext.build.getAvroSchemaOutDirPath(project, sourceSet)).parentFile) | ||
project.delete(project.file(rootProject.ext.build.getRestModelOutDirPath(project, sourceSet)).parentFile) | ||
project.delete(project.file(rootProject.ext.build.getRestClientOutDirPath(project, sourceSet)).parentFile) | ||
} | ||
|
||
// make clean depends on deleting the generated directories | ||
project.tasks.clean.dependsOn(cleanGeneratedDirTask) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
Copyright (c) 2012 LinkedIn Corp. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
String getGeneratedSourceDirName(Project project, SourceSet sourceSet, String genType) | ||
{ | ||
return "${project.projectDir.path}${File.separatorChar}src${File.separatorChar}${sourceSet.name}Generated${genType}" | ||
} | ||
|
||
project.ext.build = [ | ||
'dataTemplateTasks': [:], | ||
'avroSchemaTasks': [:], | ||
'restModelTasks': [:], | ||
'restClientTasks': [:], | ||
|
||
'getDataTemplateOutDirPath': { Project project, SourceSet sourceSet -> | ||
return getGeneratedSourceDirName(project, sourceSet, 'dataTemplate') + "${File.separatorChar}java" | ||
}, | ||
'getAvroSchemaOutDirPath': { Project project, SourceSet sourceSet -> | ||
return getGeneratedSourceDirName(project, sourceSet, 'AvroSchema') + "${File.separatorChar}avro" | ||
}, | ||
'getRestModelOutDirPath': { Project project, SourceSet sourceSet -> | ||
return getGeneratedSourceDirName(project, sourceSet, 'Rest') + "${File.separatorChar}idl" | ||
}, | ||
'getRestClientOutDirPath': { Project project, SourceSet sourceSet -> | ||
return getGeneratedSourceDirName(project, sourceSet, 'Rest') + "${File.separatorChar}java" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.