From 6063ff063b31133697b4bff82908f9b36ade271f Mon Sep 17 00:00:00 2001 From: Stypox Date: Sun, 13 Jun 2021 21:02:30 +0200 Subject: [PATCH 1/4] CONTRIBUTING.md: add "Build instructions" section and improve ordering --- .github/CONTRIBUTING.md | 54 ++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f6c3ae65a..aeca9b4ca 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -25,22 +25,54 @@ You'll see exactly what is sent, be able to add your comments, and then send it. ## Code contribution -* If you want to help out with an existing bug report or feature request, leave a comment on that issue saying you want to try your hand at it. -* If there is no existing issue for what you want to work on, open a new one describing your changes. This gives the team and the community a chance to give feedback before you spend time on something that is already in development, should be done differently, or should be avoided completely. -* Stick to NewPipe's style conventions of [checkStyle](https://github.com/checkstyle/checkstyle). It runs each time you build the project. -* Do not bring non-free software (e.g. binary blobs) into the project. Make sure you do not introduce Google - libraries. +### Guidelines + +* Stick to NewPipe's *style conventions* of [checkStyle](https://github.com/checkstyle/checkstyle) and [ktlint](https://github.com/pinterest/ktlint). They run each time you build the project. * Stick to [F-Droid contribution guidelines](https://f-droid.org/wiki/page/Inclusion_Policy). -* Make changes on a separate branch with a meaningful name, not on the _master_ branch or the _dev_ branch. This is commonly known as *feature branch workflow*. You may then send your changes as a pull request (PR) on GitHub. -* Please test (compile and run) your code before submitting changes! Ideally, provide test feedback in the PR description. Untested code will **not** be merged! -* Make sure your PR is up-to-date with the rest of the code. Often, a simple click on "Update branch" will do the job, but if not, you must rebase the dev branch manually and resolve the problems on your own. You can find help [on the wiki](https://github.com/TeamNewPipe/NewPipe/wiki/How-to-merge-a-PR). That makes the maintainers' jobs way easier. -* Please show intention to maintain your features and code after you contribute a PR. Unmaintained code is a hassle for core developers. If you do not intend to maintain features you plan to contribute, please rethink your submission, or clearly state that in the PR description. +* In particular **do not bring non-free software** (e.g. binary blobs) into the project. Make sure you do not introduce Google closed-source libraries. + +### Before starting development + +* If you want to help out with an existing bug report or feature request, **leave a comment** on that issue saying you want to try your hand at it. +* If there is no existing issue for what you want to work on, **open a new one** describing your changes. This gives the team and the community a chance to give **feedback** before you spend time on something that is already in development, should be done differently, or should be avoided completely. +* Please show **intention to maintain your features** and code after you contribute a PR. Unmaintained code is a hassle for core developers. If you do not intend to maintain features you plan to contribute, please rethink your submission, or clearly state that in the PR description. +* Send PRs that **only cover one specific issue/solution/bug**. Do not send PRs that are huge and could be split into multiple independent contributions. + +### Creating a Pull Request (PR) + +* Make changes on a **separate branch** with a meaningful name, not on the _master_ branch or the _dev_ branch. This is commonly known as *feature branch workflow*. You may then send your changes as a pull request (PR) on GitHub. +* Please **test** (compile and run) your code before submitting changes! Ideally, provide test feedback in the PR description. Untested code will **not** be merged! * Respond if someone requests changes or otherwise raises issues about your PRs. -* Send PRs that only cover one specific issue/solution/bug. Do not send PRs that are huge and consist of multiple independent solutions. * Try to figure out yourself why builds on our CI fail. +* Make sure your PR is **up-to-date** with the rest of the code. Often, a simple click on "Update branch" will do the job, but if not, you must *rebase* the dev branch manually and resolve the problems on your own. You can find help [on the wiki](https://github.com/TeamNewPipe/NewPipe/wiki/How-to-merge-a-PR). That makes the maintainers' jobs way easier. + +## Build instructions + +### Basic setup + +NewPipe is developed using [Android Studio](https://developer.android.com/studio/). The setup is fairly simple: +- Clone the NewPipe repository with `git clone https://github.com/TeamNewPipe/NewPipe.git` (or use your fork) +- Open the folder you just cloned with Android Studio +- Build and run just like you would do with any other app, with the green triangle in the top bar + +### checkStyle setup + +The [checkStyle](https://github.com/checkstyle/checkstyle) plugin verifies that Java code abides by the project style. It runs automatically each time you build the project, though to be able to view errors directly in the editor, insead of having to skim through the build output, you can install an Android Studio plugin: +- Go to `File -> Settings -> Plugins`, search for `checkstyle` and install `CheckStyle-IDEA` +- Go to `File -> Settings -> Tools -> Checkstyle` +- Add NewPipe's configuration file by clicking the upper `+` on the right +- Under the "Use a local Checkstyle file" label, click on `Browse` and pick the file named `checkstyle.xml` in the project's root folder +- Enable "Store relative to project location" so that moving the directory around does not create issues +- Insert a description in the top bar, then click `Next`, then `Finish` +- Activate the configuration file you just added by enabling the checkbox on the left +- Click `Ok` and you are done + +### ktlint setup + +The [ktlint](https://github.com/pinterest/ktlint) plugin does the same job as checkStyle for Kotlin files. Installing the related plugin is as simple as going to `File -> Settings -> Plugins`, searching for `ktlint` and installing `Ktlint (unofficial)`. ## Communication * The #newpipe channel on Libera Chat (`ircs://irc.libera.chat:6697/newpipe`) has the core team and other developers in it. [Click here for webchat](https://web.libera.chat/#newpipe)! -* You can also use a Matrix account to join the NewPipe channel at [#newpipe:libera.chat](https://matrix.to/#/#newpipe:libera.chat). +* You can also use a Matrix account to join the NewPipe channel at [#newpipe:libera.chat](https://matrix.to/#/#newpipe:libera.chat). We suggest using [Element](https://element.io/) as a Matrix client, available both for phone and desktop. * Post suggestions, changes, ideas etc. on GitHub or IRC. From 8b3e32b6eba71118399af9af2957e012d72a4538 Mon Sep 17 00:00:00 2001 From: Stypox Date: Thu, 17 Jun 2021 20:47:22 +0200 Subject: [PATCH 2/4] First round of review --- .github/CONTRIBUTING.md | 49 ++++++++++++++++++++++------------------- app/build.gradle | 3 +++ 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index aeca9b4ca..afc2820c5 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -3,9 +3,9 @@ NewPipe contribution guidelines ## Crash reporting -Report crashes through the automated crash report system of NewPipe. +Report crashes through the **automated crash report system** of NewPipe. This way all the data needed for debugging is included in your bugreport for GitHub. -You'll see exactly what is sent, be able to add your comments, and then send it. +You'll see *exactly* what is sent, be able to add **your comments**, and then send it. ## Issue reporting/feature requests @@ -29,14 +29,15 @@ You'll see exactly what is sent, be able to add your comments, and then send it. * Stick to NewPipe's *style conventions* of [checkStyle](https://github.com/checkstyle/checkstyle) and [ktlint](https://github.com/pinterest/ktlint). They run each time you build the project. * Stick to [F-Droid contribution guidelines](https://f-droid.org/wiki/page/Inclusion_Policy). -* In particular **do not bring non-free software** (e.g. binary blobs) into the project. Make sure you do not introduce Google closed-source libraries. +* In particular **do not bring non-free software** (e.g. binary blobs) into the project. Make sure you do not introduce any closed-source library from Google. ### Before starting development * If you want to help out with an existing bug report or feature request, **leave a comment** on that issue saying you want to try your hand at it. -* If there is no existing issue for what you want to work on, **open a new one** describing your changes. This gives the team and the community a chance to give **feedback** before you spend time on something that is already in development, should be done differently, or should be avoided completely. +* If there is no existing issue for what you want to work on, **open a new one** describing the changes you are planning to introduce. This gives the team and the community a chance to give **feedback** before you spend time on something that is already in development, should be done differently, or should be avoided completely. * Please show **intention to maintain your features** and code after you contribute a PR. Unmaintained code is a hassle for core developers. If you do not intend to maintain features you plan to contribute, please rethink your submission, or clearly state that in the PR description. -* Send PRs that **only cover one specific issue/solution/bug**. Do not send PRs that are huge and could be split into multiple independent contributions. +* Create PRs that cover only **one specific issue/solution/bug**. Do not create PRs that are huge monoliths and could have been split into multiple independent contributions. +* NewPipe uses [NewPipeExtractor](https://github.com/TeamNewPipe/NewPipeExtractor) to fetch data from services. If you need to change something there, you then have to test your changes in NewPipe. Telling NewPipe to use your extractor version can be accomplished by editing the `app/build.gradle` file: the comments under the "NewPipe libraries" section of `dependencies` will help you out. ### Creating a Pull Request (PR) @@ -44,35 +45,37 @@ You'll see exactly what is sent, be able to add your comments, and then send it. * Please **test** (compile and run) your code before submitting changes! Ideally, provide test feedback in the PR description. Untested code will **not** be merged! * Respond if someone requests changes or otherwise raises issues about your PRs. * Try to figure out yourself why builds on our CI fail. -* Make sure your PR is **up-to-date** with the rest of the code. Often, a simple click on "Update branch" will do the job, but if not, you must *rebase* the dev branch manually and resolve the problems on your own. You can find help [on the wiki](https://github.com/TeamNewPipe/NewPipe/wiki/How-to-merge-a-PR). That makes the maintainers' jobs way easier. +* Make sure your PR is **up-to-date** with the rest of the code. Often, a simple click on "Update branch" will do the job, but if not, you must *rebase* your branch on the `dev` branch manually and resolve the conflicts on your own. You can find help [on the wiki](https://github.com/TeamNewPipe/NewPipe/wiki/How-to-merge-a-PR). Doing this makes the maintainers' job way easier. -## Build instructions +## IDE setup & building the app ### Basic setup -NewPipe is developed using [Android Studio](https://developer.android.com/studio/). The setup is fairly simple: -- Clone the NewPipe repository with `git clone https://github.com/TeamNewPipe/NewPipe.git` (or use your fork) -- Open the folder you just cloned with Android Studio -- Build and run just like you would do with any other app, with the green triangle in the top bar +NewPipe is developed using [Android Studio](https://developer.android.com/studio/). Learn more about how to install it and how it works in the [official documentation](https://developer.android.com/studio/intro). In particular, make sure you have accepted Android Studio's SDK licences. Once Android Studio is ready, setting up the NewPipe project is fairly simple: +- Clone the NewPipe repository with `git clone https://github.com/TeamNewPipe/NewPipe.git` (or use use the link from your own fork, if you then want to open a PR). +- Open the folder you just cloned with Android Studio. +- Build and run just like you would do with any other app, with the green triangle in the top bar. ### checkStyle setup -The [checkStyle](https://github.com/checkstyle/checkstyle) plugin verifies that Java code abides by the project style. It runs automatically each time you build the project, though to be able to view errors directly in the editor, insead of having to skim through the build output, you can install an Android Studio plugin: -- Go to `File -> Settings -> Plugins`, search for `checkstyle` and install `CheckStyle-IDEA` -- Go to `File -> Settings -> Tools -> Checkstyle` -- Add NewPipe's configuration file by clicking the upper `+` on the right -- Under the "Use a local Checkstyle file" label, click on `Browse` and pick the file named `checkstyle.xml` in the project's root folder -- Enable "Store relative to project location" so that moving the directory around does not create issues -- Insert a description in the top bar, then click `Next`, then `Finish` -- Activate the configuration file you just added by enabling the checkbox on the left -- Click `Ok` and you are done +The [checkStyle](https://github.com/checkstyle/checkstyle) plugin verifies that Java code abides by the project style. It runs automatically each time you build the project, though to be able to view errors directly in the editor, instead of having to skim through the build output, you can install an Android Studio plugin: +- Go to `File -> Settings -> Plugins`, search for `checkstyle` and install `CheckStyle-IDEA`. +- Go to `File -> Settings -> Tools -> Checkstyle`. +- Add NewPipe's configuration file by clicking the `+` in the right toolbar of the "Configuration File" list. +- Under the "Use a local Checkstyle file" bullet, click on `Browse` and pick the file named `checkstyle.xml` in the project's root folder. +- Enable "Store relative to project location" so that moving the directory around does not create issues. +- Insert a description in the top bar, then click `Next` and then `Finish`. +- Activate the configuration file you just added by enabling the checkbox on the left. +- Click `Ok` and you are done. + +An alternative plugin you can choose for the same job is [SonarLint](https://www.sonarlint.org/intellij), which works for both Java and Kotlin. ### ktlint setup -The [ktlint](https://github.com/pinterest/ktlint) plugin does the same job as checkStyle for Kotlin files. Installing the related plugin is as simple as going to `File -> Settings -> Plugins`, searching for `ktlint` and installing `Ktlint (unofficial)`. +The [ktlint](https://github.com/pinterest/ktlint) plugin does the same job as checkStyle for Kotlin files. Installing the related plugin is as simple as going to `File -> Settings -> Plugins`, searching for `ktlint` and installing `Ktlint (unofficial)`. Again, [SonarLint](https://www.sonarlint.org/intellij) exists as an alternative. ## Communication * The #newpipe channel on Libera Chat (`ircs://irc.libera.chat:6697/newpipe`) has the core team and other developers in it. [Click here for webchat](https://web.libera.chat/#newpipe)! -* You can also use a Matrix account to join the NewPipe channel at [#newpipe:libera.chat](https://matrix.to/#/#newpipe:libera.chat). We suggest using [Element](https://element.io/) as a Matrix client, available both for phone and desktop. -* Post suggestions, changes, ideas etc. on GitHub or IRC. +* You can also use a Matrix account to join the NewPipe channel at [#newpipe:libera.chat](https://matrix.to/#/#newpipe:libera.chat). Some convenient clients, available both for phone and desktop, are listed at that link. +* You can post your suggestions, changes, ideas etc. on either GitHub or IRC. diff --git a/app/build.gradle b/app/build.gradle index 054d91fa5..2b4e84e5b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -182,6 +182,9 @@ dependencies { /** NewPipe libraries **/ // You can use a local version by uncommenting a few lines in settings.gradle + // Or you can use a commit you pushed to GitHub by just replacing TeamNewPipe with your GitHub + // name and the commit hash with the commit hash of the (pushed) commit you want to test + // This works thanks to JitPack: https://jitpack.io/ implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751' implementation 'com.github.TeamNewPipe:NewPipeExtractor:d4186d100b6c6dddfcf3cf4b004f5960a8bf441d' From 0db3406ad85d69cfae8fab81b206b180cdfa07c2 Mon Sep 17 00:00:00 2001 From: Stypox Date: Fri, 18 Jun 2021 12:26:50 +0200 Subject: [PATCH 3/4] Fix SonarLint references and explanation --- .github/CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index afc2820c5..8e072abaf 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -56,6 +56,8 @@ NewPipe is developed using [Android Studio](https://developer.android.com/studio - Open the folder you just cloned with Android Studio. - Build and run just like you would do with any other app, with the green triangle in the top bar. +You may find [SonarLint](https://www.sonarlint.org/intellij)'s **inspections** useful in helping you to write good code and prevent bugs. + ### checkStyle setup The [checkStyle](https://github.com/checkstyle/checkstyle) plugin verifies that Java code abides by the project style. It runs automatically each time you build the project, though to be able to view errors directly in the editor, instead of having to skim through the build output, you can install an Android Studio plugin: @@ -68,11 +70,9 @@ The [checkStyle](https://github.com/checkstyle/checkstyle) plugin verifies that - Activate the configuration file you just added by enabling the checkbox on the left. - Click `Ok` and you are done. -An alternative plugin you can choose for the same job is [SonarLint](https://www.sonarlint.org/intellij), which works for both Java and Kotlin. - ### ktlint setup -The [ktlint](https://github.com/pinterest/ktlint) plugin does the same job as checkStyle for Kotlin files. Installing the related plugin is as simple as going to `File -> Settings -> Plugins`, searching for `ktlint` and installing `Ktlint (unofficial)`. Again, [SonarLint](https://www.sonarlint.org/intellij) exists as an alternative. +The [ktlint](https://github.com/pinterest/ktlint) plugin does the same job as checkStyle for Kotlin files. Installing the related plugin is as simple as going to `File -> Settings -> Plugins`, searching for `ktlint` and installing `Ktlint (unofficial)`. ## Communication From 25914b0263a80d98876083318a69a0b5923c7700 Mon Sep 17 00:00:00 2001 From: Stypox Date: Thu, 24 Jun 2021 10:46:53 +0200 Subject: [PATCH 4/4] Third round of review --- .github/CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8e072abaf..81d969427 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -37,7 +37,7 @@ You'll see *exactly* what is sent, be able to add **your comments**, and then se * If there is no existing issue for what you want to work on, **open a new one** describing the changes you are planning to introduce. This gives the team and the community a chance to give **feedback** before you spend time on something that is already in development, should be done differently, or should be avoided completely. * Please show **intention to maintain your features** and code after you contribute a PR. Unmaintained code is a hassle for core developers. If you do not intend to maintain features you plan to contribute, please rethink your submission, or clearly state that in the PR description. * Create PRs that cover only **one specific issue/solution/bug**. Do not create PRs that are huge monoliths and could have been split into multiple independent contributions. -* NewPipe uses [NewPipeExtractor](https://github.com/TeamNewPipe/NewPipeExtractor) to fetch data from services. If you need to change something there, you then have to test your changes in NewPipe. Telling NewPipe to use your extractor version can be accomplished by editing the `app/build.gradle` file: the comments under the "NewPipe libraries" section of `dependencies` will help you out. +* NewPipe uses [NewPipeExtractor](https://github.com/TeamNewPipe/NewPipeExtractor) to fetch data from services. If you need to change something there, you must test your changes in NewPipe. Telling NewPipe to use your extractor version can be accomplished by editing the `app/build.gradle` file: the comments under the "NewPipe libraries" section of `dependencies` will help you out. ### Creating a Pull Request (PR) @@ -52,15 +52,15 @@ You'll see *exactly* what is sent, be able to add **your comments**, and then se ### Basic setup NewPipe is developed using [Android Studio](https://developer.android.com/studio/). Learn more about how to install it and how it works in the [official documentation](https://developer.android.com/studio/intro). In particular, make sure you have accepted Android Studio's SDK licences. Once Android Studio is ready, setting up the NewPipe project is fairly simple: -- Clone the NewPipe repository with `git clone https://github.com/TeamNewPipe/NewPipe.git` (or use use the link from your own fork, if you then want to open a PR). +- Clone the NewPipe repository with `git clone https://github.com/TeamNewPipe/NewPipe.git` (or use the link from your own fork, if you want to open a PR). - Open the folder you just cloned with Android Studio. -- Build and run just like you would do with any other app, with the green triangle in the top bar. +- Build and run it just like you would do with any other app, with the green triangle in the top bar. You may find [SonarLint](https://www.sonarlint.org/intellij)'s **inspections** useful in helping you to write good code and prevent bugs. ### checkStyle setup -The [checkStyle](https://github.com/checkstyle/checkstyle) plugin verifies that Java code abides by the project style. It runs automatically each time you build the project, though to be able to view errors directly in the editor, instead of having to skim through the build output, you can install an Android Studio plugin: +The [checkStyle](https://github.com/checkstyle/checkstyle) plugin verifies that Java code abides by the project style. It runs automatically each time you build the project. If you want to view errors directly in the editor, instead of having to skim through the build output, you can install an Android Studio plugin: - Go to `File -> Settings -> Plugins`, search for `checkstyle` and install `CheckStyle-IDEA`. - Go to `File -> Settings -> Tools -> Checkstyle`. - Add NewPipe's configuration file by clicking the `+` in the right toolbar of the "Configuration File" list.