This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gradle-plugin): do not add logsender dependency if it is disabled (…
- Loading branch information
Showing
15 changed files
with
241 additions
and
64 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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,24 @@ | ||
/* | ||
* This file is part of AndroidIDE. | ||
* | ||
* AndroidIDE is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* AndroidIDE is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
plugins { | ||
//noinspection JavaPluginLanguageLevel | ||
id("java-library") | ||
id("com.vanniktech.maven.publish.base") | ||
} | ||
|
||
description = "Configuration options for the Tooling API and Gradle Plugin." |
53 changes: 53 additions & 0 deletions
53
gradle-plugin-config/src/main/java/com/itsaky/androidide/tooling/api/LogSenderConfig.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* This file is part of AndroidIDE. | ||
* | ||
* AndroidIDE is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* AndroidIDE is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.itsaky.androidide.tooling.api; | ||
|
||
/** | ||
* Configuration options for LogSender. Properties defined in this class whose name start with an | ||
* <code>_</code> are internal. | ||
* | ||
* @author Akash Yadav | ||
*/ | ||
public final class LogSenderConfig { | ||
|
||
/** | ||
* Property to enable or disable <code>LogSender</code> in the project. Value can be | ||
* <code>true</code> or <code>false</code>. | ||
*/ | ||
public static final String PROPERTY_LOGSENDER_ENABLED = "androidide.logsender.isEnabled"; | ||
|
||
/** | ||
* Property that is set in tests to indicate that the plugin is being applied in a test | ||
* environment. | ||
* <p> | ||
* <b>This is an internal property and should not be manually set by users.</b> | ||
*/ | ||
public static final String _PROPERTY_IS_TEST_ENV = "androidide.plugins.internal.isTestEnv"; | ||
|
||
/** | ||
* Property that is set in tests to provide path to the local maven repository. If this property | ||
* is empty, `null` or not set at all, the default maven local repository is used. | ||
* | ||
* <b>This is an internal property and should not be manually set by users.</b> | ||
*/ | ||
public static final String _PROPERTY_MAVEN_LOCAL_REPOSITORY = "androidide.plugins.internal.mavenLocalRepositories"; | ||
|
||
private LogSenderConfig() { | ||
throw new UnsupportedOperationException("This class cannot be instantiated."); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
gradle-plugin-config/src/main/java/com/itsaky/androidide/tooling/api/ToolingConfig.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* This file is part of AndroidIDE. | ||
* | ||
* AndroidIDE is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* AndroidIDE is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.itsaky.androidide.tooling.api; | ||
|
||
/** | ||
* Configuration options for the Tooling API. | ||
* | ||
* @author Akash Yadav | ||
*/ | ||
public final class ToolingConfig { | ||
|
||
private ToolingConfig() { | ||
throw new UnsupportedOperationException("This class cannot be instantiated."); | ||
} | ||
} |
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
50 changes: 50 additions & 0 deletions
50
gradle-plugin/src/test/java/com/itsaky/androidide/gradle/AndroidIDEPluginTest.kt
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,50 @@ | ||
/* | ||
* This file is part of AndroidIDE. | ||
* | ||
* AndroidIDE is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* AndroidIDE is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.itsaky.androidide.gradle | ||
|
||
import com.google.common.truth.Truth.assertThat | ||
import com.itsaky.androidide.tooling.api.LogSenderConfig.PROPERTY_LOGSENDER_ENABLED | ||
import org.junit.jupiter.api.Test | ||
|
||
/** | ||
* @author Akash Yadav | ||
*/ | ||
class AndroidIDEPluginTest { | ||
|
||
@Test | ||
fun `test logsender must be enabled by default`() { | ||
val result = buildProject() | ||
assertThat(result.output).doesNotContain("LogSender is disabled") | ||
} | ||
|
||
@Test | ||
fun `test logsender must be enabled if specified explicitly`() { | ||
val result = buildProject(configureArgs = { | ||
it.add("-P$PROPERTY_LOGSENDER_ENABLED=true") | ||
}) | ||
assertThat(result.output).doesNotContain("LogSender is disabled") | ||
} | ||
|
||
@Test | ||
fun `test logsender must be disabled if specified explicitly`() { | ||
val result = buildProject(configureArgs = { | ||
it.add("-P$PROPERTY_LOGSENDER_ENABLED=false") | ||
}) | ||
assertThat(result.output).contains("LogSender is disabled") | ||
} | ||
} |
Oops, something went wrong.