Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
compiler:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

Expand Down
10 changes: 5 additions & 5 deletions ApacheThrift.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -25,8 +25,8 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>ApacheThrift</id>
<version>0.20.0</version>
<title>Apache Thrift 0.20.0</title>
<version>0.20.1</version>
<title>Apache Thrift 0.20.1</title>
<authors>Apache Thrift Developers</authors>
<owners>Apache Software Foundation</owners>
<license type="expression">Apache-2.0</license>
Expand All @@ -42,4 +42,4 @@
<files>
<file src="lib\netstd\Thrift\bin\Release\netstandard2.0\*.*" target="lib\netstandard2.0" />
</files>
</package>
</package>
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
#

cmake_minimum_required(VERSION 3.4)
cmake_minimum_required(VERSION 3.16)

if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW) # package version behavior added in cmake 3.0
Expand All @@ -28,7 +28,7 @@ endif()

# PACKAGE_VERSION is used by cpack scripts currently
# Both thrift_VERSION and PACKAGE_VERSION should be the same for now
set(thrift_VERSION "0.20.0")
set(thrift_VERSION "0.20.1")
set(PACKAGE_VERSION ${thrift_VERSION})

project("thrift" VERSION ${PACKAGE_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion Thrift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Thrift'
s.version = '0.20.0'
s.version = '0.20.1'
s.summary = "Apache Thrift is a lightweight, language-independent software stack with an associated code generation mechanism for RPC."
s.description = <<-DESC
The Apache Thrift scalable cross-language software framework for networked services development combines a software stack with a code generation engine to build services that work efficiently and seamlessly between many programming languages.
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# build Apache Thrift on AppVeyor - https://ci.appveyor.com

version: '0.20.0.{build}'
version: '0.20.1.{build}'

shallow_clone: true

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "thrift",
"version": "0.20.0",
"version": "0.20.1",
"homepage": "https://github.com/apache/thrift.git",
"authors": [
"Apache Thrift <dev@thrift.apache.org>"
Expand Down
2 changes: 1 addition & 1 deletion compiler/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
#

cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.16)
project("thrift-compiler" VERSION ${PACKAGE_VERSION})

# version.h now handled via veralign.sh
Expand Down
65 changes: 35 additions & 30 deletions compiler/cpp/src/thrift/generate/t_js_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,12 @@ class t_js_generator : public t_oop_generator {
std::string get_import_path(t_program* program);
std::string declare_field(t_field* tfield, bool init = false, bool obj = false);
std::string function_signature(t_function* tfunction,
std::string prefix = "",
bool include_callback = false);
std::string argument_list(t_struct* tstruct, bool include_callback = false);
std::string prefix = "",
bool include_callback = false,
const std::string& callback_name = "callback");
std::string argument_list(t_struct* tstruct,
bool include_callback = false,
const std::string& callback_name = "callback");
std::string type_to_enum(t_type* ttype);
std::string make_valid_nodeJs_identifier(std::string const& name);
std::string next_identifier_name(std::vector<t_field*> const& fields, std::string const& base_name);
Expand Down Expand Up @@ -313,9 +316,10 @@ class t_js_generator : public t_oop_generator {
* TypeScript Definition File helper functions
*/

string ts_function_signature(t_function* tfunction, bool include_callback);
string ts_get_type(t_type* type);

string ts_function_signature(t_function* tfunction,
bool include_callback,
const std::string& callback_name = "callback");
string ts_get_type(t_type* type);
/**
* Special indentation for TypeScript Definitions because of the module.
* Returns the normal indentation + " " if a module was defined.
Expand Down Expand Up @@ -927,9 +931,9 @@ void t_js_generator::generate_js_struct_definition(ostream& out,

// Special case. Exceptions derive from Error, and error has a non optional message field.
// Ignore the optional flag in this case, otherwise we will generate a incompatible field
// in the eyes of typescript.
// in the eyes of typescript.
string optional_flag = is_exception && member_name == "message" ? "" : ts_get_req(*m_iter);

f_types_ts_ << ts_indent() << ts_access << member_name << optional_flag << ": "
<< ts_get_type((*m_iter)->get_type()) << ";" << endl;
}
Expand Down Expand Up @@ -1830,6 +1834,7 @@ void t_js_generator::generate_service_client(t_service* tservice) {
for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
t_struct* arg_struct = (*f_iter)->get_arglist();
const vector<t_field*>& fields = arg_struct->get_members();
const std::string callback_name = next_identifier_name(fields, "callback");
vector<t_field*>::const_iterator fld_iter;
string funname = (*f_iter)->get_name();
string arglist = argument_list(arg_struct);
Expand All @@ -1840,20 +1845,20 @@ void t_js_generator::generate_service_client(t_service* tservice) {
indent(f_service_) << funname << " (" << arglist << ") {" << endl;
} else {
indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype."
<< function_signature(*f_iter, "", !gen_es6_) << " {" << endl;
<< function_signature(*f_iter, "", !gen_es6_, callback_name) << " {" << endl;
}

indent_up();

if (gen_ts_) {
// function definition without callback
f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, false) << endl;
f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, false, callback_name) << endl;
if (!gen_es6_) {
// overload with callback
f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << endl;
f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true, callback_name) << endl;
} else {
// overload with callback
f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << endl;
f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true, callback_name) << endl;
}
}

Expand All @@ -1872,7 +1877,7 @@ void t_js_generator::generate_service_client(t_service* tservice) {
indent(f_service_) << "});" << endl;
} else if (gen_node_) { // Node.js output ./gen-nodejs
f_service_ << indent() << "this._seqid = this.new_seqid();" << endl << indent()
<< "if (callback === undefined) {" << endl;
<< "if (" << callback_name << " === undefined) {" << endl;
indent_up();
f_service_ << indent() << js_const_type_ << "_defer = Q.defer();" << endl << indent()
<< "this._reqs[this.seqid()] = function(error, result) {" << endl;
Expand All @@ -1893,7 +1898,7 @@ void t_js_generator::generate_service_client(t_service* tservice) {
indent_down();
indent(f_service_) << "} else {" << endl;
indent_up();
f_service_ << indent() << "this._reqs[this.seqid()] = callback;" << endl << indent()
f_service_ << indent() << "this._reqs[this.seqid()] = " << callback_name << ";" << endl << indent()
<< "this.send_" << funname << "(" << arglist << ");" << endl;
indent_down();
indent(f_service_) << "}" << endl;
Expand All @@ -1911,7 +1916,7 @@ void t_js_generator::generate_service_client(t_service* tservice) {
f_service_ << indent() << "});" << endl;

} else if (gen_jquery_) { // jQuery output ./gen-js
f_service_ << indent() << "if (callback === undefined) {" << endl;
f_service_ << indent() << "if (" << callback_name << " === undefined) {" << endl;
indent_up();
f_service_ << indent() << "this.send_" << funname << "(" << arglist << ");" << endl;
if (!(*f_iter)->is_oneway()) {
Expand All @@ -1935,9 +1940,9 @@ void t_js_generator::generate_service_client(t_service* tservice) {
f_service_ << indent() << "}" << endl;
} else { // Standard JavaScript ./gen-js
f_service_ << indent() << "this.send_" << funname << "(" << arglist
<< (arglist.empty() ? "" : ", ") << "callback); " << endl;
<< (arglist.empty() ? "" : ", ") << callback_name << "); " << endl;
if (!(*f_iter)->is_oneway()) {
f_service_ << indent() << "if (!callback) {" << endl;
f_service_ << indent() << "if (!" << callback_name << ") {" << endl;
f_service_ << indent();
if (!(*f_iter)->get_returntype()->is_void()) {
f_service_ << " return ";
Expand Down Expand Up @@ -2643,24 +2648,22 @@ string t_js_generator::declare_field(t_field* tfield, bool init, bool obj) {
*/
string t_js_generator::function_signature(t_function* tfunction,
string prefix,
bool include_callback) {

bool include_callback,
const std::string& callback_name) {
string str;

str = prefix + tfunction->get_name() + " = function(";

str += argument_list(tfunction->get_arglist(), include_callback);

str += argument_list(tfunction->get_arglist(), include_callback, callback_name);
str += ")";
return str;
}

/**
* Renders a field list
*/
string t_js_generator::argument_list(t_struct* tstruct, bool include_callback) {
string t_js_generator::argument_list(t_struct* tstruct,
bool include_callback,
const std::string& callback_name) {
string result = "";

const vector<t_field*>& fields = tstruct->get_members();
vector<t_field*>::const_iterator f_iter;
bool first = true;
Expand All @@ -2677,7 +2680,7 @@ string t_js_generator::argument_list(t_struct* tstruct, bool include_callback) {
if (!fields.empty()) {
result += ", ";
}
result += "callback";
result += callback_name;
}

return result;
Expand Down Expand Up @@ -2818,7 +2821,9 @@ string t_js_generator::ts_get_type(t_type* type) {
* @param bool in-/exclude the callback argument
* @return String of rendered function definition
*/
std::string t_js_generator::ts_function_signature(t_function* tfunction, bool include_callback) {
std::string t_js_generator::ts_function_signature(t_function* tfunction,
bool include_callback,
const std::string& callback_name) {
string str;
const vector<t_field*>& fields = tfunction->get_arglist()->get_members();
vector<t_field*>::const_iterator f_iter;
Expand Down Expand Up @@ -2857,12 +2862,12 @@ std::string t_js_generator::ts_function_signature(t_function* tfunction, bool in
}
}
if (exception_types == "") {
str += "callback: (error: void, response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
str += callback_name + ": (error: void, response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
} else {
str += "callback: (error: " + exception_types + ", response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
str += callback_name + ": (error: " + exception_types + ", response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
}
} else {
str += "callback: (data: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
str += callback_name + ": (data: " + ts_get_type(tfunction->get_returntype()) + ")=>void): ";
}

if (gen_jquery_) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/cpp/src/thrift/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
#pragma once
#endif // _MSC_VER

#define THRIFT_VERSION "0.20.0"
#define THRIFT_VERSION "0.20.1"

#endif // _THRIFT_VERSION_H_
4 changes: 2 additions & 2 deletions compiler/cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.16)

project(thrift_compiler_tests)

Expand Down Expand Up @@ -61,7 +61,7 @@ add_library(parse STATIC ${parse_SOURCES})
set(thrift_compiler_tests
)

# you can add some files manually there
# you can add some files manually there
set(thrift_compiler_tests_manual_SOURCES
# tests file to avoid main in every test file
${CMAKE_CURRENT_SOURCE_DIR}/tests_main.cc
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
AC_PREREQ(2.65)
AC_CONFIG_MACRO_DIR([./aclocal])

AC_INIT([thrift], [0.20.0])
AC_INIT([thrift], [0.20.1])

AC_CONFIG_AUX_DIR([.])

Expand Down
4 changes: 2 additions & 2 deletions contrib/Rebus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@

[assembly: Guid("0af10984-40d3-453d-b1e5-421529e8c7e2")]

[assembly: AssemblyVersion("0.20.0.0")]
[assembly: AssemblyFileVersion("0.20.0.0")]
[assembly: AssemblyVersion("0.20.1.0")]
[assembly: AssemblyFileVersion("0.20.1.0")]
4 changes: 2 additions & 2 deletions contrib/thrift-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<artifactId>thrift-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>thrift-maven-plugin</name>
<version>0.20.0</version>
<version>0.20.1</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down Expand Up @@ -108,4 +108,4 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>
</project>
4 changes: 2 additions & 2 deletions contrib/thrift.spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Name: thrift
License: Apache License v2.0
Group: Development
Summary: RPC and serialization framework
Version: 0.20.0
Version: 0.20.1
Release: 0
URL: http://thrift.apache.org
Packager: Thrift Developers <dev@thrift.apache.org>
Expand Down Expand Up @@ -248,5 +248,5 @@ umask 007
%changelog
* Wed Aug 21 2013 Thrift Dev <dev@thrift.apache.org>
- Thrift 0.9.1 release.
* Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org>
* Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org>
- Thrift 0.9.0 release.
2 changes: 1 addition & 1 deletion contrib/zeromq/csharp/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("0.20.0.0")]
[assembly: AssemblyVersion("0.20.1.0")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/idl.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Thrift interface description language

For Thrift version 0.20.0.
For Thrift version 0.20.1.

The Thrift interface definition language (IDL) allows for the definition of [Thrift Types](/docs/types). A Thrift IDL file is processed by the Thrift code generator to produce code for the various target languages to support the defined structs and services in the IDL file.

Expand Down
2 changes: 1 addition & 1 deletion lib/d/src/thrift/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TCompoundOperationException : TException {
/// The Thrift version string, used for informative purposes.
// Note: This is currently hardcoded, but will likely be filled in by the build
// system in future versions.
enum VERSION = "0.20.0";
enum VERSION = "0.20.1";

/**
* Functions used for logging inside Thrift.
Expand Down
4 changes: 2 additions & 2 deletions lib/dart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

name: thrift
version: 0.20.0
version: 0.20.1
description: >
A Dart library for Apache Thrift
author: Apache Thrift Developers <dev@thrift.apache.org>
Expand All @@ -40,4 +40,4 @@ dev_dependencies:
dart_style: ">=1.3.1 <3.0.0"
mockito: ">=4.1.1 <6.0.0"
test: ^1.9.1
workiva_analysis_options: ^1.0.0
workiva_analysis_options: ^1.0.0
2 changes: 1 addition & 1 deletion lib/delphi/src/Thrift.pas
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface
Thrift.Protocol;

const
Version = '0.20.0';
Version = '0.20.1';

type
TException = Thrift.Exception.TException; // compatibility alias
Expand Down
Loading
Loading