Skip to content

Commit 22394d7

Browse files
release: 0.0.2
release: 0.0.2
2 parents d203acc + 22454d0 commit 22394d7

File tree

18 files changed

+222
-75
lines changed

18 files changed

+222
-75
lines changed

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6+
7+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8+
9+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10+
11+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12+
13+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html

CONTRIBUTING.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Contribution
2+
3+
We welcome contributions to [Sourcerer App](https://github.com/sourcerer-io/sourcerer-app) by the community.
4+
5+
See [README](https://github.com/sourcerer-io/sourcerer-app) for more information about prerequirements and building project.
6+
7+
## How to report a problem
8+
9+
Please search before creating a new issue. Feel free to add issues related to the app or [sourcerer](https://sourcerer.io) site.
10+
11+
## Submitting сhanges
12+
13+
* Open a new issue in the [issue tracker](https://github.com/sourcerer-io/sourcerer-app/issues).
14+
* Fork and clone the repo with `git clone https://github.com/your-username/sourcerer-app.git`.
15+
* Create a new branch based off the `develop` branch.
16+
* Make changes.
17+
* Make sure all tests pass.
18+
* Submit a pull request, referencing any issues it addresses.
19+
20+
We will review your Pull Request as soon as possible. Thank you for contributing!
21+
22+
## Integration testing
23+
24+
We will work on a special environment for contributors in the nearest future. For now one should use his personal or additional account on site.
25+
26+
## Style guides
27+
### Commit messages
28+
29+
Format:
30+
```type(component): message (jira issue tag, github issue number with #)```
31+
32+
Message types:
33+
* **feat** is used when new feature is provided;
34+
* **wip** is used when making regular commit and changes don't match any other types;
35+
* **fix** is used when you fix a bug;
36+
* **chore** is used when changes are about organization, not about logic;
37+
* **docs** is used when you add/change documentation.
38+
Component is a decomposition unit your commit affected. Write message in present simple.
39+
40+
Examples:
41+
feat(logger): add rotating
42+
chore: remove redundant commas, add copyright
43+
wip: pass models to routers
44+
fix: program exit is prevented when button is pressed (COMP-1, #123)
45+
46+
### Kotlin style guide
47+
* Code has a column limit of 80 characters.
48+
* Inline comments should be indented with 2 spaces from code.
49+
50+
We are using [Kotlin Coding Conventions](https://kotlinlang.org/docs/reference/coding-conventions.html).
51+
52+
## Code of conduct
53+
We value input from each member of the community, however we urge you to abide by [code of conduct](https://github.com/sourcerer-io/sourcerer-app/blob/master/CODE_OF_CONDUCT.md).

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2017 Sourcerer, Inc. https://sourcerer.io
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Prerequirements
1717

1818
* Sourcerer alpha/beta access
1919
* Linux or macOS
20-
* Java Platform ([JRE](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html) for Linux or [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) for macOS)
20+
* Java 8+ Platform ([JRE](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html) for Linux or [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) for macOS)
2121
* Git repositories with master branch with at least one commit
2222

2323
Install/uninstall
@@ -26,7 +26,7 @@ Install/uninstall
2626
To install sourcerer run the following command:
2727

2828
```
29-
curl -s https://sourcerer.io/install | bash
29+
curl -s https://sourcerer.io/app/install | bash
3030
```
3131

3232
To remove sourcerer from your machine:
@@ -53,3 +53,8 @@ $ gradle build -Penv=production
5353
# Run the app
5454
$ java -jar build/libs/sourcerer-app.jar
5555
```
56+
57+
Contribution
58+
============
59+
60+
We welcome contributions to Sourcerer App by the community. Check the [Contribution guide](https://github.com/sourcerer-io/sourcerer-app/blob/master/CONTRIBUTING.md)) for more information.

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ buildConfig {
3636
buildConfigField 'String', 'PROFILE_URL', 'https://sourcerer.io/'
3737

3838
// App version.
39-
buildConfigField 'int', 'VERSION_CODE', '1'
40-
buildConfigField 'String', 'VERSION', '0.0.1'
39+
buildConfigField 'int', 'VERSION_CODE', '2'
40+
buildConfigField 'String', 'VERSION', '0.0.2'
4141

4242
// Logging.
43+
buildConfigField 'String', 'ENV', project.hasProperty('env') ? env : 'production'
4344
buildConfigField 'String', 'LOG_LEVEL', project.hasProperty('log') ? log : 'info'
4445

4546
// Google Analytics.

deploy/sourcerer-app.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
apiVersion: v1
12
kind: Service
23
metadata:
34
name: sourcerer-app

do.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ build_jar_inside() {
4747
else
4848
API="https://sourcerer.io/api/commit"
4949
fi
50-
gradle -Plog=$LOG -Papi=$API build
50+
gradle -Penv=$NAMESPACE -Plog=$LOG -Papi=$API build
5151
}
5252

5353
build_jar() {

src/install/install

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Copyright 2017 Sourcerer, Inc. All Rights Reserved.
2-
#
2+
# License: MIT, https://github.com/sourcerer-io/sourcerer-app/blob/master/LICENSE.md
3+
# Source code: https://github.com/sourcerer-io
34

45
echo "Installing sourcerer app.."
5-
66
SERVER=$SERVER_EXT
77
DOWNLOAD_URL=$SERVER/app/download
88
SCRIPT_DIR=$HOME/.sourcerer
@@ -21,6 +21,9 @@ mkdir -p $JAR_DIR
2121
curl -s $DOWNLOAD_URL > $JAR_DIR/sourcerer.jar
2222

2323
cat <<EOF > $SCRIPT_DIR/sourcerer
24+
# Copyright 2017 Sourcerer, Inc. All Rights Reserved.
25+
# License: MIT, https://github.com/sourcerer-io/sourcerer-app/blob/master/LICENSE.md
26+
# Source code: https://github.com/sourcerer-io
2427

2528
if [ "\$1" = "--uninstall" ] ; then
2629
read -p "The script will uninstall sourcerer app. Proceed? [Y/n] " yesno < /dev/tty
@@ -37,20 +40,31 @@ if [ "\$1" = "--uninstall" ] ; then
3740
exit
3841
fi
3942

40-
if ! which java > /dev/null ; then
43+
VERSION=0
44+
if which java > /dev/null ; then
45+
VERSION_STR=\$(java -version 2>&1 | awk -F '"' '/version/ {print \$2}')
46+
if [[ "\$VERSION_STR" > "9." ]]; then # Format: 9.0.1
47+
VERSION=9
48+
elif [[ "\$VERSION_STR" > "1.8." ]]; then # Format: 1.8.1
49+
VERSION=8
50+
else
51+
echo "Installed version of Java is not supported."
52+
fi
53+
fi
54+
55+
if [ \$VERSION = 0 ] ; then
4156
if [ `uname` = "Darwin" ] ; then
42-
echo "Sourcerer requires JDK installed on the system. You can download it from here:"
57+
echo "Sourcerer requires JDK 8+ installed on the system. You can download it from:"
4358
echo "http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html"
4459
else
45-
echo "Sourcerer requires JRE installed on the system. You can download it from here:"
60+
echo "Sourcerer requires JRE 8+ installed on the system. You can download it from:"
4661
echo "http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html"
4762
fi
4863
exit 1
4964
fi
5065

5166
# Java 9 requires additional parameters.
52-
version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
53-
if [[ "$version" > "9." ]]; then # Version example for Java 9: 9.0.1
67+
if [ \$VERSION = 9 ] ; then
5468
java --add-modules java.activation --add-opens java.base/java.nio=ALL-UNNAMED -jar $JAR_DIR/sourcerer.jar "\$@"
5569
else
5670
java -jar $JAR_DIR/sourcerer.jar "\$@"
@@ -59,13 +73,14 @@ EOF
5973

6074
chmod +x $SCRIPT_DIR/sourcerer
6175

62-
6376
{
6477
rm -f /usr/local/bin/sourcerer 2> /dev/null &&
6578
ln -s $SCRIPT_DIR/sourcerer /usr/local/bin/sourcerer 2> /dev/null &&
66-
echo "Done!" &&
67-
echo "Run sourcerer to start hashing your repos!"
79+
echo 'Done!' &&
80+
echo 'Run sourcerer to start hashing your repos!'
6881
} || {
69-
echo 'We installed app to $HOME/.sourcerer/sourcerer.'
70-
echo 'You can add it to $PATH or ln it to /usr/local/bin'
82+
echo 'We installed app to ~/.sourcerer/sourcerer.'
83+
echo 'You can add it to $PATH or run specified command to finish installation:'
84+
echo "sudo ln -s $SCRIPT_DIR/sourcerer /usr/local/bin/sourcerer"
85+
echo 'Then run sourcerer to start hashing your repos!'
7186
}

src/main/kotlin/app/Logger.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ object Logger {
226226
val javaVendor = System.getProperty("java.vendor", default)
227227
val javaVersion = System.getProperty("java.version", default)
228228

229+
sentryContext.addTag("environment", BuildConfig.ENV)
229230
sentryContext.addTag("log-level", BuildConfig.LOG_LEVEL)
230231
sentryContext.addTag("version", BuildConfig.VERSION)
231232
sentryContext.addTag("version-code", BuildConfig.VERSION_CODE

src/main/kotlin/app/extractors/JavascriptExtractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import app.model.DiffFile
1010
class JavascriptExtractor : ExtractorInterface {
1111
companion object {
1212
val LANGUAGE_NAME = "javascript"
13-
val FILE_EXTS = listOf("js")
13+
val FILE_EXTS = listOf("js", "jsx")
1414
val LIBRARIES = ExtractorInterface.getLibraries("js")
1515
val evaluator by lazy {
1616
ExtractorInterface.getLibraryClassifier(LANGUAGE_NAME)

0 commit comments

Comments
 (0)