diff --git a/boot/platform/build.gradle b/boot/platform/build.gradle index 084fe1fb..4b178825 100644 --- a/boot/platform/build.gradle +++ b/boot/platform/build.gradle @@ -15,7 +15,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-data-redis-reactive") //implementation("org.springframework.boot:spring-boot-starter-jooq") - implementation("org.jooq:jooq") + //implementation("org.jooq:jooq") implementation("org.springframework.boot:spring-boot-starter-data-r2dbc") implementation("org.postgresql:r2dbc-postgresql") diff --git a/boot/platform/src/main/java/com/plate/boot/commons/utils/ContextUtils.java b/boot/platform/src/main/java/com/plate/boot/commons/utils/ContextUtils.java index 1e4c7bcc..92623ec7 100644 --- a/boot/platform/src/main/java/com/plate/boot/commons/utils/ContextUtils.java +++ b/boot/platform/src/main/java/com/plate/boot/commons/utils/ContextUtils.java @@ -7,7 +7,6 @@ import com.plate.boot.security.SecurityDetails; import com.plate.boot.security.core.user.UsersService; import lombok.extern.log4j.Log4j2; -import org.jooq.DSLContext; import org.springframework.beans.factory.InitializingBean; import org.springframework.http.HttpHeaders; import org.springframework.http.server.reactive.ServerHttpRequest; @@ -107,18 +106,15 @@ public final class ContextUtils implements InitializingBean { */ public static UsersService USERS_SERVICE; - public static DSLContext JOOQDSL; - /** * Initializes the ContextUtils class with necessary dependencies. * * @param objectMapper The ObjectMapper instance used for JSON serialization and deserialization. * @param usersService The UsersService instance to provide access to user-related operations. */ - ContextUtils(ObjectMapper objectMapper, UsersService usersService, DSLContext create) { + ContextUtils(ObjectMapper objectMapper, UsersService usersService) { ContextUtils.OBJECT_MAPPER = objectMapper; ContextUtils.USERS_SERVICE = usersService; - ContextUtils.JOOQDSL = create; } /** diff --git a/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryFragment.java b/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryFragment.java index 40b9f120..406d0eb0 100644 --- a/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryFragment.java +++ b/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryFragment.java @@ -20,11 +20,11 @@ *
  * {@code
  * QueryFragment queryFragment = QueryFragment.withNew()
- *     .addColumn("id", "name", "email")
- *     .addQuery("users")
- *     .addWhere("age > :age", 18)
- *     .addOrder("name ASC")
- *     .addOrder("email DESC");
+ *     .columns("id", "name", "email")
+ *     .query("users")
+ *     .where("age > :age", 18)
+ *     .orderBy("name ASC")
+ *     .orderBy("email DESC");
  *
  * // Bind parameters
  * queryFragment.put("age", 18);
@@ -48,7 +48,7 @@ public class QueryFragment extends HashMap {
      * Example usage:
      * 
      * {@code
-     * queryFragment.addColumn("id", "name", "email");
+     * queryFragment.columns("id", "name", "email");
      * }
      * 
*/ @@ -59,18 +59,18 @@ public class QueryFragment extends HashMap { * Example usage: *
      * {@code
-     * queryFragment.addQuery("users");
+     * queryFragment.query("users");
      * }
      * 
*/ - private final StringJoiner select = new StringJoiner(" "); + private final StringJoiner from = new StringJoiner(" "); /** * A StringJoiner to accumulate WHERE conditions. * Example usage: *
      * {@code
-     * queryFragment.addWhere("age > :age");
+     * queryFragment.where("age > :age");
      * }
      * 
*/ @@ -81,7 +81,7 @@ public class QueryFragment extends HashMap { * Example usage: *
      * {@code
-     * queryFragment.addOrder("name ASC");
+     * queryFragment.orderBy("name ASC");
      * }
      * 
*/ @@ -92,26 +92,30 @@ public class QueryFragment extends HashMap { /** * The maximum number of rows to return (LIMIT clause). */ - private final int size; + private int size = 25; /** * The number of rows to skip before starting to return rows (OFFSET clause). */ - private final long offset; + private long offset = 0; - public QueryFragment(int size, long offset, QueryFragment params) { - super(16); - this.size = size; - this.offset = offset; - this.mergeWhere(params.getWhere()); - this.putAll(params); + public QueryFragment(QueryFragment fragment) { + super(fragment); + this.size = fragment.size; + this.offset = fragment.offset; + this.columns.merge(fragment.getColumns()); + this.from.merge(fragment.getFrom()); + this.orderBy.merge(fragment.getOrderBy()); + this.where.merge(fragment.getWhere()); } - public QueryFragment(int size, long offset, Map params) { - super(16); - this.size = size; - this.offset = offset; - this.putAll(params); + /** + * Creates a new QueryFragment instance with the specified parameters. + * + * @param params the parameters to initialize the QueryFragment with + */ + public QueryFragment(Map params) { + super(params); } public static QueryFragment withNew() { @@ -119,11 +123,11 @@ public static QueryFragment withNew() { } public static QueryFragment withMap(Map params) { - return new QueryFragment(Integer.MAX_VALUE, 0, params); + return new QueryFragment(params); } public static QueryFragment withMap(int size, long offset, Map params) { - return new QueryFragment(size, offset, params); + return withMap(params).limit(size, offset); } public static QueryFragment of(QueryFragment params) { @@ -131,25 +135,25 @@ public static QueryFragment of(QueryFragment params) { } public static QueryFragment of(int size, long offset, QueryFragment params) { - return new QueryFragment(size, offset, params); + return of(params).limit(size, offset); } - public QueryFragment addColumn(CharSequence... columns) { + public QueryFragment columns(CharSequence... columns) { for (CharSequence column : columns) { this.columns.add(column); } return this; } - public QueryFragment addQuery(CharSequence... queries) { - this.select.setEmptyValue(""); + public QueryFragment query(CharSequence... queries) { + this.from.setEmptyValue(""); for (CharSequence query : queries) { - this.select.add(query); + this.from.add(query); } return this; } - public QueryFragment addWhere(CharSequence where) { + public QueryFragment where(CharSequence where) { this.where.add(where); return this; } @@ -157,43 +161,27 @@ public QueryFragment addWhere(CharSequence where) { /** * Adds an ORDER BY clause to the query. * - * @param order the order - * @return this + * @param order the order to add + * @return the QueryFragment instance */ - public QueryFragment addOrder(CharSequence order) { + public QueryFragment orderBy(CharSequence order) { this.orderBy.add(order); return this; } /** - * Merges the given where clause with the existing one. - * - * @param where the where - * @return this - */ - public QueryFragment mergeWhere(StringJoiner where) { - this.where.merge(where); - return this; - } - - /** - * Merges the given order clause with the existing one. + * Adds a GROUP BY clause to the query. * - * @param order the order - * @return this + * @param size page size + * @param offset page offset + * @return the QueryFragment instance */ - public QueryFragment mergeOrder(StringJoiner order) { - this.orderBy.merge(order); + public QueryFragment limit(int size, long offset) { + this.size = size; + this.offset = offset; return this; } - /** - * Generates the WHERE clause part of a SQL query based on the stored conditions. - * If conditions have been accumulated, it prefixes the conditions with the 'WHERE' keyword; - * otherwise, it returns an empty string to indicate no conditions. - * - * @return A String forming the WHERE clause of the SQL query, or an empty string if no conditions are present. - */ public String whereSql() { if (this.where.length() > 0) { return " WHERE " + this.where; @@ -220,9 +208,9 @@ public String orderSql() { * @throws QueryException if the querySql is null, indicating that the query structure is incomplete. */ public String querySql() { - if (this.select.length() > 0) { + if (this.from.length() > 0) { return String.format("SELECT %s FROM %s %s %s LIMIT %d OFFSET %d", - this.columns, this.select, whereSql(), orderSql(), this.size, this.offset); + this.columns, this.from, whereSql(), orderSql(), this.size, this.offset); } throw QueryException.withError("This querySql is null, please use whereSql() method!", new IllegalArgumentException("This querySql is null, please use whereSql() method")); @@ -240,8 +228,8 @@ public String querySql() { * @throws QueryException if the countSql is null, indicating that the query structure is incomplete. */ public String countSql() { - if (this.select.length() > 0) { - return "SELECT COUNT(*) FROM (" + String.format("SELECT %s FROM %s", this.columns, this.select) + if (this.from.length() > 0) { + return "SELECT COUNT(*) FROM (" + String.format("SELECT %s FROM %s", this.columns, this.from) + whereSql() + ") t"; } throw QueryException.withError("This countSql is null, please use whereSql() method!", diff --git a/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryHelper.java b/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryHelper.java index a489f487..1e87a4a8 100644 --- a/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryHelper.java +++ b/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryHelper.java @@ -241,7 +241,7 @@ private static void processQueryKey(QueryFragment queryFragment, Map) objectMap.get("query"); var jsonQueryFragment = QueryJsonHelper.queryJson(jsonMap, prefix); - queryFragment.mergeWhere(jsonQueryFragment.getWhere()); + queryFragment.getWhere().merge(jsonQueryFragment.getWhere()); queryFragment.putAll(jsonQueryFragment); } } @@ -257,7 +257,7 @@ private static void processQueryKey(QueryFragment queryFragment, Map objectMap, Collection skipKeys, String prefix) { if (!skipKeys.contains("securityCode") && objectMap.containsKey("securityCode")) { var column = StringUtils.hasLength(prefix) ? prefix + ".tenant_code" : "tenant_code"; - queryFragment.addWhere(column + " LIKE :securityCode"); + queryFragment.where(column + " LIKE :securityCode"); queryFragment.put("securityCode", objectMap.get("securityCode")); } } @@ -273,9 +273,9 @@ private static void processSearchKey(QueryFragment queryFragment, Map entry : queryFragment.entrySet()) { String conditionSql = buildConditionSql(entry, prefix); - queryFragment.addWhere(conditionSql); + queryFragment.where(conditionSql); } } @@ -352,8 +352,8 @@ public static void applyQuerySql(QueryFragment queryFragment, Object object) { } String tableName = StringUtils.hasLength(table.value()) ? table.value() : objectClass.getName(); - queryFragment.addColumn("*"); - queryFragment.addQuery(tableName); + queryFragment.columns("*"); + queryFragment.query(tableName); } /** diff --git a/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryJsonHelper.java b/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryJsonHelper.java index 8b3f1d19..a1cf3d5c 100644 --- a/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryJsonHelper.java +++ b/boot/platform/src/main/java/com/plate/boot/commons/utils/query/QueryJsonHelper.java @@ -165,7 +165,7 @@ public static QueryFragment queryJson(Map params, String prefix) QueryFragment queryFragment = QueryFragment.withNew(); for (Map.Entry entry : params.entrySet()) { var condition = buildJsonCondition(entry, prefix); - queryFragment.mergeWhere(condition.getWhere()); + queryFragment.getWhere().merge(condition.getWhere()); queryFragment.putAll(condition); } return queryFragment; @@ -232,7 +232,7 @@ private static QueryFragment buildJsonCondition(Map.Entry entry, //处理最后键 QueryFragment lastCondition = buildLastCondition(keys, entry.getValue()); conditionBuilder.append(lastCondition.getWhere()); - return QueryFragment.withMap(lastCondition).addWhere(conditionBuilder.toString()); + return QueryFragment.withMap(lastCondition).where(conditionBuilder.toString()); } /** @@ -260,7 +260,7 @@ private static QueryFragment buildLastCondition(String[] keys, Object value) { Map.Entry exps = queryKeywordMapper(lastKey); if (exps == null) { conditionSql.append(lastKey).append("' = :").append(paramName); - return QueryFragment.withMap(Map.of(paramName, value)).addWhere(conditionSql.toString()); + return QueryFragment.withMap(Map.of(paramName, value)).where(conditionSql.toString()); } String key = lastKey.substring(0, lastKey.length() - exps.getKey().length()); @@ -280,7 +280,7 @@ private static QueryFragment buildLastCondition(String[] keys, Object value) { conditionSql.append(exps.getValue()).append(" :").append(paramName); params = Map.of(paramName, value); } - return QueryFragment.withMap(params).addWhere(conditionSql.toString()); + return QueryFragment.withMap(params).where(conditionSql.toString()); } /** diff --git a/boot/platform/src/main/java/com/plate/boot/config/R2dbcConfiguration.java b/boot/platform/src/main/java/com/plate/boot/config/R2dbcConfiguration.java index 9c5d36b0..955cb4e6 100644 --- a/boot/platform/src/main/java/com/plate/boot/config/R2dbcConfiguration.java +++ b/boot/platform/src/main/java/com/plate/boot/config/R2dbcConfiguration.java @@ -6,9 +6,6 @@ import io.r2dbc.spi.ConnectionFactories; import io.r2dbc.spi.ConnectionFactory; import lombok.RequiredArgsConstructor; -import org.jooq.DSLContext; -import org.jooq.SQLDialect; -import org.jooq.impl.DSL; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.converter.Converter; @@ -16,7 +13,6 @@ import org.springframework.data.r2dbc.config.AbstractR2dbcConfiguration; import org.springframework.data.r2dbc.config.EnableR2dbcAuditing; import org.springframework.lang.NonNull; -import org.springframework.r2dbc.connection.TransactionAwareConnectionFactoryProxy; import org.springframework.transaction.annotation.EnableTransactionManagement; import java.util.List; @@ -75,11 +71,4 @@ public ReactiveAuditorAware userAuditorProvider() { return new UserAuditorAware(); } - @Bean - public DSLContext dslContext(ConnectionFactory connectionFactory) { - return DSL.using( - new TransactionAwareConnectionFactoryProxy(connectionFactory), - SQLDialect.POSTGRES - ); - } } \ No newline at end of file diff --git a/boot/platform/src/main/java/com/plate/boot/security/SecurityManager.java b/boot/platform/src/main/java/com/plate/boot/security/SecurityManager.java index 9a306a4e..3bb3407e 100644 --- a/boot/platform/src/main/java/com/plate/boot/security/SecurityManager.java +++ b/boot/platform/src/main/java/com/plate/boot/security/SecurityManager.java @@ -64,24 +64,24 @@ public class SecurityManager extends AbstractDatabase implements ReactiveUserDetailsService, ReactiveUserDetailsPasswordService { private final static QueryFragment QUERY_GROUP_MEMBERS_FRAGMENT = QueryFragment.withNew() - .addColumn("a.*", "b.name", "b.extend") - .addQuery("se_group_members a", "join se_groups b on a.group_code=b.code") - .addWhere("a.user_code like :userCode"); + .columns("a.*", "b.name", "b.extend") + .query("se_group_members a", "join se_groups b on a.group_code=b.code") + .where("a.user_code like :userCode"); private final static QueryFragment QUERY_TENANT_MEMBERS_FRAGMENT = QueryFragment.withNew() - .addColumn("a.*", "b.name", "b.extend") - .addQuery("se_tenant_members a", "join se_tenants b on a.tenant_code=b.code") - .addWhere("a.user_code like :userCode"); + .columns("a.*", "b.name", "b.extend") + .query("se_tenant_members a", "join se_tenants b on a.tenant_code=b.code") + .where("a.user_code like :userCode"); private final static QueryFragment QUERY_USER_AUTHORITY_FRAGMENT = QueryFragment.withNew() - .addColumn("*") - .addQuery("se_authorities") - .addWhere("user_code = :userCode"); + .columns("*") + .query("se_authorities") + .where("user_code = :userCode"); private final static QueryFragment QUERY_GROUP_AUTHORITY_FRAGMENT = QueryFragment.withNew() - .addColumn("ga.*") - .addQuery("se_group_authorities ga", + .columns("ga.*") + .query("se_group_authorities ga", "join se_group_members gm on ga.group_code = gm.group_code", "join se_users su on gm.user_code = su.code", "join se_groups sg on gm.group_code = sg.code and sg.tenant_code = su.tenant_code") - .addWhere("gm.user_code = :userCode"); + .where("gm.user_code = :userCode"); /** * Represents the service layer for handling user-related operations. @@ -133,8 +133,8 @@ public Mono registerOrModifyUser(UserRequest request) { * @return A Mono emitting the User if found, or an empty Mono if no user matches the given OAuth2 binding data. */ public Mono loadByOauth2(String bindType, String openid) { - QueryFragment queryFragment = QueryFragment.withNew().addColumn("*").addQuery("se_users") - .addWhere("extend->'oauth2'->:bindType->>'openid'::varchar = :openid"); + QueryFragment queryFragment = QueryFragment.withNew().columns("*").query("se_users") + .where("extend->'oauth2'->:bindType->>'openid'::varchar = :openid"); queryFragment.put("bindType", bindType); queryFragment.put("openid", openid); var userMono = this.databaseClient.sql(queryFragment::querySql).bindValues(queryFragment) diff --git a/boot/platform/src/main/java/com/plate/boot/security/core/group/member/GroupMemberReq.java b/boot/platform/src/main/java/com/plate/boot/security/core/group/member/GroupMemberReq.java index 1c6bad72..a4c5d30f 100644 --- a/boot/platform/src/main/java/com/plate/boot/security/core/group/member/GroupMemberReq.java +++ b/boot/platform/src/main/java/com/plate/boot/security/core/group/member/GroupMemberReq.java @@ -36,12 +36,12 @@ public Criteria toCriteria() { public QueryFragment toParamSql() { QueryFragment queryFragment = QueryHelper.query(this, List.of("users", "username"), "a"); if (!ObjectUtils.isEmpty(this.getUsers())) { - queryFragment.addWhere("a.user_code in :users"); + queryFragment.where("a.user_code in :users"); queryFragment.put("users", this.getUsers()); } if (StringUtils.hasLength(this.getUsername())) { - queryFragment.addWhere("c.username = :username"); + queryFragment.where("c.username = :username"); queryFragment.put("username", this.getUsername()); } diff --git a/boot/platform/src/main/java/com/plate/boot/security/core/tenant/member/TenantMemberRequest.java b/boot/platform/src/main/java/com/plate/boot/security/core/tenant/member/TenantMemberRequest.java index add814db..275cc9d5 100644 --- a/boot/platform/src/main/java/com/plate/boot/security/core/tenant/member/TenantMemberRequest.java +++ b/boot/platform/src/main/java/com/plate/boot/security/core/tenant/member/TenantMemberRequest.java @@ -44,17 +44,17 @@ public QueryFragment toParamSql() { QueryFragment fragment = QueryHelper.query(this, List.of("users", "securityCode", "username"), "a"); if (!ObjectUtils.isEmpty(this.getUsers())) { - fragment.addWhere("a.user_code in (:users)"); + fragment.where("a.user_code in (:users)"); fragment.put("users", StringUtils.collectionToCommaDelimitedString(this.getUsers())); } if (StringUtils.hasLength(this.getSecurityCode())) { - fragment.addWhere("a.tenant_code like :securityCode"); + fragment.where("a.tenant_code like :securityCode"); fragment.put("securityCode", this.getSecurityCode()); } if (StringUtils.hasLength(this.getUsername())) { - fragment.addWhere("c.username = :username"); + fragment.where("c.username = :username"); fragment.put("username", this.getUsername()); } diff --git a/boot/platform/src/main/java/com/plate/boot/security/core/tenant/member/TenantMembersService.java b/boot/platform/src/main/java/com/plate/boot/security/core/tenant/member/TenantMembersService.java index f19a2f08..fd5be862 100644 --- a/boot/platform/src/main/java/com/plate/boot/security/core/tenant/member/TenantMembersService.java +++ b/boot/platform/src/main/java/com/plate/boot/security/core/tenant/member/TenantMembersService.java @@ -28,9 +28,9 @@ public class TenantMembersService extends AbstractDatabase { public Flux search(TenantMemberRequest request, Pageable pageable) { QueryFragment fragment = request.toParamSql(); QueryFragment queryFragment = QueryFragment.of(pageable.getPageSize(), pageable.getOffset(), fragment) - .addColumn("a.*", "b.name as tenant_name", + .columns("a.*", "b.name as tenant_name", "b.extend as tenant_extend", "c.name as login_name", "c.username") - .addQuery("se_tenant_members a", + .query("se_tenant_members a", "inner join se_tenants b on a.tenant_code = b.code", "inner join se_users c on c.code = a.user_code"); QueryHelper.applySort(queryFragment, pageable.getSort(), "a"); diff --git a/boot/platform/src/test/java/com/plate/boot/BootApplicationTest.java b/boot/platform/src/test/java/com/plate/boot/BootApplicationTest.java index d2f3881b..eae88339 100644 --- a/boot/platform/src/test/java/com/plate/boot/BootApplicationTest.java +++ b/boot/platform/src/test/java/com/plate/boot/BootApplicationTest.java @@ -5,7 +5,6 @@ /** * @author Alex Bob */ -//@SpringBootTest(classes = InfrastructureConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) class BootApplicationTest { @Test diff --git a/boot/platform/src/test/java/com/plate/boot/commons/utils/query/QueryHelperTest.java b/boot/platform/src/test/java/com/plate/boot/commons/utils/query/QueryHelperTest.java deleted file mode 100644 index ac21f142..00000000 --- a/boot/platform/src/test/java/com/plate/boot/commons/utils/query/QueryHelperTest.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.plate.boot.commons.utils.query; - -import org.junit.jupiter.api.Test; - -class QueryHelperTest { - - @Test - void jooqTest() { - } -} \ No newline at end of file diff --git a/boot/platform/src/test/java/com/plate/boot/config/InfrastructureConfiguration.java b/boot/platform/src/test/java/com/plate/boot/config/InfrastructureConfiguration.java index 33db9d13..6d6bb6aa 100644 --- a/boot/platform/src/test/java/com/plate/boot/config/InfrastructureConfiguration.java +++ b/boot/platform/src/test/java/com/plate/boot/config/InfrastructureConfiguration.java @@ -10,5 +10,4 @@ @SpringBootApplication(exclude = {SecurityAutoConfiguration.class, SecurityConfiguration.class}) @EnableTransactionManagement public class InfrastructureConfiguration { - } diff --git a/build.gradle b/build.gradle index 6fba0eb1..c1bc049c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'org.springframework.boot' version '3.4.1' apply false - id 'io.spring.dependency-management' version '1.1.6' + id 'io.spring.dependency-management' version '1.1.7' id 'org.graalvm.buildtools.native' version '0.10.3' } @@ -36,6 +36,12 @@ configure(subprojects - project(":boot")) { project -> ] } + java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } + } + configurations { compileOnly { extendsFrom annotationProcessor diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136..a4b76b95 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4413138..cea7a793 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..f3b75f3b 100644 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30db..9d21a218 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ##########################################################################