Skip to content

Commit

Permalink
Google Spreadsheet Reading (#1976)
Browse files Browse the repository at this point in the history
  • Loading branch information
kustosz authored Sep 3, 2021
1 parent c9e6fa2 commit a81257b
Show file tree
Hide file tree
Showing 79 changed files with 1,193 additions and 28 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,12 @@ jobs:
- name: Prepare Engine Test Environment
shell: bash
run: |
mkdir -p test/Google_Api_Test/data
echo "$GDOC_KEY" > test/Google_Api_Test/data/secret.json
go get -v github.com/ahmetb/go-httpbin/cmd/httpbin
$(go env GOPATH)/bin/httpbin -host :8080 &
env:
GDOC_KEY: ${{secrets.GDOC_TEST_CREDENTIAL}}

- name: Install Graalpython & FastR
if: runner.os != 'Windows'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,5 @@ distribution/lib/Standard/Database/*/polyglot/
distribution/lib/Standard/Examples/*/data/spreadsheet.xls
distribution/lib/Standard/Examples/*/data/spreadsheet.xlsx

test/Google_Api_Test/data/secret.json
test/Database_Tests/data/redshift_credentials.json
5 changes: 5 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Enso Next

## Libraries

- Added support for fetching tables from Google Spreadsheets.
([#1976](https://github.com/enso-org/enso/pull/1976)).

# Enso 0.2.28 (2021-09-02)

## Libraries
Expand Down
30 changes: 30 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ GatherLicenses.distributions := Seq(
Distribution.sbtProjects(`project-manager`)
),
makeStdLibDistribution("Base", Distribution.sbtProjects(`std-base`)),
makeStdLibDistribution(
"Google_Api",
Distribution.sbtProjects(`std-google-api`)
),
makeStdLibDistribution("Table", Distribution.sbtProjects(`std-table`)),
makeStdLibDistribution("Database", Distribution.sbtProjects(`std-database`)),
makeStdLibDistribution("Image", Distribution.sbtProjects(`std-image`))
Expand Down Expand Up @@ -1146,6 +1150,7 @@ lazy val runtime = (project in file("engine/runtime"))
.dependsOn(`std-base` / Compile / packageBin)
.dependsOn(`std-image` / Compile / packageBin)
.dependsOn(`std-database` / Compile / packageBin)
.dependsOn(`std-google-api` / Compile / packageBin)
.dependsOn(`std-table` / Compile / packageBin)
.value
)
Expand Down Expand Up @@ -1508,6 +1513,8 @@ def stdLibComponentRoot(name: String): File =
val `base-polyglot-root` = stdLibComponentRoot("Base") / "polyglot" / "java"
val `table-polyglot-root` = stdLibComponentRoot("Table") / "polyglot" / "java"
val `image-polyglot-root` = stdLibComponentRoot("Image") / "polyglot" / "java"
val `google-api-polyglot-root` =
stdLibComponentRoot("Google_Api") / "polyglot" / "java"
val `database-polyglot-root` =
stdLibComponentRoot("Database") / "polyglot" / "java"

Expand Down Expand Up @@ -1581,6 +1588,29 @@ lazy val `std-image` = project
}.value
)

lazy val `std-google-api` = project
.in(file("std-bits") / "google-api")
.settings(
autoScalaLibrary := false,
Compile / packageBin / artifactPath :=
`google-api-polyglot-root` / "std-image.jar",
libraryDependencies ++= Seq(
"com.google.api-client" % "google-api-client" % "1.32.1",
"com.google.apis" % "google-api-services-sheets" % "v4-rev612-1.25.0"
),
Compile / packageBin := Def.task {
val result = (Compile / packageBin).value
val _ = StdBits
.copyDependencies(
`google-api-polyglot-root`,
Some("std-google-api.jar"),
ignoreScalaLibrary = true
)
.value
result
}.value
)

lazy val `std-database` = project
.in(file("std-bits") / "database")
.settings(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
Enso
Copyright 2020 - 2021 New Byte Order sp. z o. o.

'google-api-client', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.api-client.google-api-client-1.32.1`.


'google-api-services-sheets', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.apis.google-api-services-sheets-v4-rev612-1.25.0`.


'jsr305', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.code.findbugs.jsr305-3.0.2`.


'gson', licensed under the Apache 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.code.gson.gson-2.8.6`.


'error_prone_annotations', licensed under the Apache 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.errorprone.error_prone_annotations-2.5.1`.


'failureaccess', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.guava.failureaccess-1.0.1`.


'guava', licensed under the Apache License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.guava.guava-30.1.1-android`.


'listenablefuture', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.guava.listenablefuture-9999.0-empty-to-avoid-conflict-with-guava`.


'google-http-client', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.http-client.google-http-client-1.39.2`.


'google-http-client-apache-v2', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.http-client.google-http-client-apache-v2-1.39.2`.


'google-http-client-gson', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.http-client.google-http-client-gson-1.39.2`.


'j2objc-annotations', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.j2objc.j2objc-annotations-1.3`.


'google-oauth-client', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.google.oauth-client.google-oauth-client-1.31.5`.


'commons-codec', licensed under the Apache License, Version 2.0, is distributed with the Google_Api.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `commons-codec.commons-codec-1.11`.


'commons-logging', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `commons-logging.commons-logging-1.2`.


'grpc-context', licensed under the Apache 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `io.grpc.grpc-context-1.27.2`.


'opencensus-api', licensed under the The Apache License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `io.opencensus.opencensus-api-0.28.0`.


'opencensus-contrib-http-util', licensed under the The Apache License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `io.opencensus.opencensus-contrib-http-util-0.28.0`.


'httpclient', licensed under the Apache License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `org.apache.httpcomponents.httpclient-4.5.13`.


'httpcore', licensed under the Apache License, Version 2.0, is distributed with the Google_Api.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `org.apache.httpcomponents.httpcore-4.4.14`.


'checker-compat-qual', licensed under the The MIT License, is distributed with the Google_Api.
The license file can be found at `licenses/MIT`.
Copyright notices related to this dependency can be found in the directory `org.checkerframework.checker-compat-qual-2.5.5`.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2015, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

Copyright 2010 Google Inc.

Copyright 2011 Google Inc.

Copyright 2012 Google Inc.

Copyright 2013 Google Inc.

Copyright 2014 Google Inc.

Copyright 2015 Google Inc.

Copyright 2020 Google LLC
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright 2010 Google Inc.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (c) 2005 Brian Goetz
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Copyright (C) 2008 Google Inc.

Copyright (C) 2009 Google Inc.

Copyright (C) 2010 Google Inc.

Copyright (C) 2011 Google Inc.

Copyright (C) 2012 Google Inc.

Copyright (C) 2014 Google Inc.

Copyright (C) 2017 The Gson authors

Copyright (C) 2018 The Gson authors
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2014 The Error Prone Authors.

Copyright 2015 The Error Prone Authors.

Copyright 2016 The Error Prone Authors.

Copyright 2017 The Error Prone Authors.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (C) 2018 The Guava Authors
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* This method was rewritten in Java from an intermediate step of the Murmur hash function in
* http://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp, which contained the
* following header:
*
* MurmurHash3 was written by Austin Appleby, and is placed in the public domain. The author
* hereby disclaims copyright to this source code.
*/

/*
* MurmurHash3 was written by Austin Appleby, and is placed in the public
* domain. The author hereby disclaims copyright to this source code.
*/

Copyright (C) 2005 The Guava Authors

Copyright (C) 2006 The Guava Authors

Copyright (C) 2007 The Guava Authors

Copyright (C) 2008 The Guava Authors

Copyright (C) 2009 The Guava Authors

Copyright (C) 2010 The Guava Authors

Copyright (C) 2011 The Guava Authors

Copyright (C) 2011 The Guava Authors.

Copyright (C) 2012 The Guava Authors

Copyright (C) 2013 The Guava Authors

Copyright (C) 2014 The Guava Authors

Copyright (C) 2015 The Guava Authors

Copyright (C) 2016 The Guava Authors

Copyright (C) 2017 The Guava Authors

Copyright (C) 2018 The Guava Authors

Copyright (C) 2019 The Guava Authors

Copyright (C) 2020 The Guava Authors

Copyright 2019 The Guava Authors
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
See com.google.guava.guava-29.0-jre for licensing information.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) 2010 Google Inc.

Copyright (c) 2010 Google Inc.J

Copyright (c) 2011 Google Inc.

Copyright (c) 2011 Google Inc.

Copyright (c) 2012 Google Inc.

Copyright (c) 2013 Google Inc.

Copyright (c) 2014 Google Inc.

Copyright (c) 2018 Google Inc.

Copyright 2012 Google LLC

Copyright 2012 Google LLC.

Copyright 2019 Google LLC

Copyright 2019 Google LLC

Copyright 2020 Google LLC
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright 2019 Google LLC
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (c) 2011 Google Inc.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright 2012 Google Inc. All Rights Reserved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2010 Google Inc.

Copyright (c) 2011 Google Inc.

Copyright (c) 2012 Google Inc.

Copyright (c) 2013 Google Inc.
Loading

0 comments on commit a81257b

Please sign in to comment.