Skip to content

Commit

Permalink
Move build-logic to gradle folder (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
serbelga authored Mar 17, 2024
1 parent 3ec3ce0 commit 7709bd5
Show file tree
Hide file tree
Showing 19 changed files with 109 additions and 110 deletions.
2 changes: 1 addition & 1 deletion compose-vectorize-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.androidLibrary)
alias(libs.plugins.vanniktechMavenPublish)
id("dev.sergiobelda.compose.vectorize.spotless")
id("dev.sergiobelda.gradle.spotless")
}

group = "dev.sergiobelda.compose.vectorize"
Expand Down
2 changes: 1 addition & 1 deletion compose-vectorize-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
plugins {
`kotlin-dsl`
alias(libs.plugins.gradlePublish)
id("dev.sergiobelda.compose.vectorize.spotless")
id("dev.sergiobelda.gradle.spotless")
}

group = "dev.sergiobelda.compose.vectorize"
Expand Down
1 change: 0 additions & 1 deletion build-logic/.gitignore → gradle/build-logic/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
/convention/build/
/local.properties
.gradle
/imagevectorgenerator/build/
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
`kotlin-dsl`
}

group = "dev.sergiobelda.compose.vectorize.buildlogic"
group = "dev.sergiobelda.gradle"

java {
toolchain {
Expand All @@ -19,9 +19,9 @@ dependencies {
gradlePlugin {
plugins {
register("spotless") {
id = "dev.sergiobelda.compose.vectorize.spotless"
id = "dev.sergiobelda.gradle.spotless"
implementationClass =
"dev.sergiobelda.compose.vectorize.buildlogic.convention.SpotlessConventionPlugin"
"dev.sergiobelda.gradle.buildlogic.convention.SpotlessConventionPlugin"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package dev.sergiobelda.compose.vectorize.buildlogic.convention
package dev.sergiobelda.gradle.buildlogic.convention

import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.Plugin
Expand Down
File renamed without changes.
184 changes: 92 additions & 92 deletions build-logic/gradlew.bat → gradle/build-logic/gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencyResolutionManagement {
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
from(files("../libs.versions.toml"))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", ver
androidx-activityCompose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
androidx-compose-composeBom = { module = "androidx.compose:compose-bom", version.ref = "composeBom" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-ui = { module = "androidx.compose.ui:ui-tooling-preview" }
androidx-compose-uiGraphics = { module = "androidx.compose.ui:ui-tooling-preview" }
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
androidx-compose-uiGraphics = { module = "androidx.compose.ui:ui-graphics" }
androidx-compose-uiTooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-compose-uiToolingPreview = { module = "androidx.compose.ui:ui-tooling-preview" }
androidx-coreKtx = { module = "androidx.core:core-ktx", version.ref = "androidCore" }
Expand Down
2 changes: 1 addition & 1 deletion sample-mpp/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlin)
id("dev.sergiobelda.compose.vectorize.spotless")
id("dev.sergiobelda.gradle.spotless")
}

android {
Expand Down
2 changes: 1 addition & 1 deletion sample-mpp/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.composeMultiplatform)
id("dev.sergiobelda.compose.vectorize")
id("dev.sergiobelda.compose.vectorize.spotless")
id("dev.sergiobelda.gradle.spotless")
}

group = "dev.sergiobelda.compose.vectorize.sample.common"
Expand Down
2 changes: 1 addition & 1 deletion sample-mpp/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
kotlin("multiplatform")
alias(libs.plugins.composeMultiplatform)
id("dev.sergiobelda.compose.vectorize.spotless")
id("dev.sergiobelda.gradle.spotless")
}

kotlin {
Expand Down
2 changes: 1 addition & 1 deletion sample-mpp/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pluginManagement {
includeBuild("../build-logic")
includeBuild("../gradle/build-logic")
repositories {
google()
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion sample-mpp/web/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
plugins {
kotlin("multiplatform")
alias(libs.plugins.composeMultiplatform)
id("dev.sergiobelda.compose.vectorize.spotless")
id("dev.sergiobelda.gradle.spotless")
}

group = "dev.sergiobelda.compose.vectorize.sample.web"
Expand Down
2 changes: 1 addition & 1 deletion sample/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("dev.sergiobelda.compose.vectorize")
id("dev.sergiobelda.compose.vectorize.spotless")
id("dev.sergiobelda.gradle.spotless")
}

group = "dev.sergiobelda.compose.vectorize"
Expand Down
2 changes: 1 addition & 1 deletion sample/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pluginManagement {
includeBuild("../build-logic")
includeBuild("../gradle/build-logic")
repositories {
google()
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pluginManagement {
includeBuild("build-logic")
includeBuild("gradle/build-logic")
repositories {
google()
mavenCentral()
Expand Down

0 comments on commit 7709bd5

Please sign in to comment.