1 Star 0 Fork 0

xht666/hibernate-orm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
utilities.gradle 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
apply plugin: UtilitiesPlugin
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
class UtilitiesPlugin implements Plugin<Project> {
def void apply(Project project) {
project.convention.plugins.utilities = new UtilitiesPluginDef()
}
}
class UtilitiesPluginDef {
@SuppressWarnings("GrUnnecessarySemicolon")
public String determinePackageName(SourceDirectorySet sourceDirectorySet, File javaFile) {
final javaFileAbsolutePath = javaFile.absolutePath;
for ( File sourceDirectory : sourceDirectorySet.srcDirs ) {
final String sourceDirectoryAbsolutePath = sourceDirectory.absolutePath;
if ( javaFileAbsolutePath.startsWith( sourceDirectoryAbsolutePath ) ) {
final String javaFileRelativePath = javaFileAbsolutePath.substring(
sourceDirectoryAbsolutePath.length() + 1,
javaFileAbsolutePath.lastIndexOf( File.separator )
);
return javaFileRelativePath.replace( File.separator, "." );
}
}
throw new RuntimeException( "ugh" );
}
String java9ModuleName(Project project) {
String name = project.name
// alternative is to just use the full project name (don't drop the 'hibernate-' prefix)
if ( name.startsWith( 'hibernate-' ) ) {
name = name.drop( 'hibernate-'.length() )
}
return name
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xht666/hibernate-orm.git
git@gitee.com:xht666/hibernate-orm.git
xht666
hibernate-orm
hibernate-orm
master

搜索帮助