2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

Remove leading lib prefix on all projects

This commit is contained in:
s1lent 2017-10-22 23:00:45 +07:00
parent d86c9ce39e
commit 3317627359
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
7 changed files with 93 additions and 2 deletions

View File

@ -1,11 +1,12 @@
import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils
import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.GradleCppUtils
import org.gradle.nativeplatform.NativeExecutableSpec
import org.gradle.nativeplatform.NativeExecutableBinarySpec
import org.gradle.nativeplatform.toolchain.VisualCpp
apply plugin: 'cpp'
apply plugin: 'windows-resources'

View File

@ -3,6 +3,7 @@ import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.GradleCppUtils
import org.gradle.nativeplatform.NativeBinarySpec
import org.gradle.nativeplatform.NativeLibrarySpec
import org.gradle.nativeplatform.toolchain.VisualCpp
@ -150,6 +151,19 @@ model {
}
}
task buildFinalize << {
if (GradleCppUtils.windows) {
return;
}
binaries.withType(SharedLibraryBinarySpec) {
def sharedBinary = it.getSharedLibraryFile();
if (sharedBinary.exists()) {
sharedBinary.renameTo(new File(sharedBinary.getParent() + "/" + sharedBinary.getName().replaceFirst("^lib", "")));
}
}
}
task buildFixes {
dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib ->
blib.buildable && blib.buildType.name == 'release'
@ -162,6 +176,10 @@ task buildRelease {
}
}
build.finalizedBy(buildFinalize);
buildFixes.finalizedBy(buildFinalize);
buildRelease.finalizedBy(buildFinalize);
// prevent static lib building
binaries.withType(StaticLibraryBinarySpec) { binary ->
buildable = false

View File

@ -3,6 +3,7 @@ import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.GradleCppUtils
import org.gradle.nativeplatform.NativeBinarySpec
import org.gradle.nativeplatform.NativeLibrarySpec
import org.gradle.nativeplatform.toolchain.VisualCpp
@ -135,6 +136,19 @@ model {
}
}
task buildFinalize << {
if (GradleCppUtils.windows) {
return;
}
binaries.withType(SharedLibraryBinarySpec) {
def sharedBinary = it.getSharedLibraryFile();
if (sharedBinary.exists()) {
sharedBinary.renameTo(new File(sharedBinary.getParent() + "/" + sharedBinary.getName().replaceFirst("^lib", "")));
}
}
}
task buildFixes {
dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib ->
blib.buildable && blib.buildType.name == 'release'
@ -147,6 +161,10 @@ task buildRelease {
}
}
build.finalizedBy(buildFinalize);
buildFixes.finalizedBy(buildFinalize);
buildRelease.finalizedBy(buildFinalize);
// prevent static lib building
binaries.withType(StaticLibraryBinarySpec) { binary ->
buildable = false

View File

@ -3,6 +3,7 @@ import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.GradleCppUtils
import org.gradle.nativeplatform.NativeBinarySpec
import org.gradle.nativeplatform.NativeLibrarySpec
import org.gradle.nativeplatform.toolchain.VisualCpp
@ -135,6 +136,19 @@ model {
}
}
task buildFinalize << {
if (GradleCppUtils.windows) {
return;
}
binaries.withType(SharedLibraryBinarySpec) {
def sharedBinary = it.getSharedLibraryFile();
if (sharedBinary.exists()) {
sharedBinary.renameTo(new File(sharedBinary.getParent() + "/" + sharedBinary.getName().replaceFirst("^lib", "")));
}
}
}
task buildFixes {
dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib ->
blib.buildable && blib.buildType.name == 'release'
@ -147,6 +161,10 @@ task buildRelease {
}
}
build.finalizedBy(buildFinalize);
buildFixes.finalizedBy(buildFinalize);
buildRelease.finalizedBy(buildFinalize);
// prevent static lib building
binaries.withType(StaticLibraryBinarySpec) { binary ->
buildable = false

View File

@ -3,6 +3,7 @@ import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.GradleCppUtils
import org.gradle.nativeplatform.NativeBinarySpec
import org.gradle.nativeplatform.NativeLibrarySpec
import org.gradle.nativeplatform.toolchain.VisualCpp
@ -161,6 +162,19 @@ model {
}
}
task buildFinalize << {
if (GradleCppUtils.windows) {
return;
}
binaries.withType(SharedLibraryBinarySpec) {
def sharedBinary = it.getSharedLibraryFile();
if (sharedBinary.exists()) {
sharedBinary.renameTo(new File(sharedBinary.getParent() + "/" + sharedBinary.getName().replaceFirst("^lib", "")));
}
}
}
task buildFixes {
dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib ->
blib.buildable && blib.buildType.name == 'release'
@ -173,6 +187,10 @@ task buildRelease {
}
}
build.finalizedBy(buildFinalize);
buildFixes.finalizedBy(buildFinalize);
buildRelease.finalizedBy(buildFinalize);
// prevent static lib building
binaries.withType(StaticLibraryBinarySpec) { binary ->
buildable = false

View File

@ -355,6 +355,19 @@ model {
}
}
task buildFinalize << {
if (GradleCppUtils.windows) {
return;
}
binaries.withType(SharedLibraryBinarySpec) {
def sharedBinary = it.getSharedLibraryFile();
if (sharedBinary.exists()) {
sharedBinary.renameTo(new File(sharedBinary.getParent() + "/" + sharedBinary.getName().replaceFirst("^lib", "")));
}
}
}
task buildRelease {
dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib ->
blib.buildable && blib.buildType.name == 'release' && !blib.name.contains('Rehlds_hooker_engine')
@ -373,6 +386,10 @@ task buildEngine {
}
}
buildFixes.finalizedBy(buildFinalize);
buildEngine.finalizedBy(buildFinalize);
buildRelease.finalizedBy(buildFinalize);
gradle.taskGraph.whenReady { graph ->
if (!graph.hasTask(buildFixes) && !graph.hasTask(buildEngine)) {
return;

View File

@ -1,11 +1,12 @@
import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils
import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.GradleCppUtils
import org.gradle.nativeplatform.NativeExecutableSpec
import org.gradle.nativeplatform.NativeExecutableBinarySpec
import org.gradle.nativeplatform.toolchain.VisualCpp
apply plugin: 'cpp'
apply plugin: 'windows-resources'