Skip to content

Commit

Permalink
Merge pull request #1434 from Catrobat/release-0.6.14
Browse files Browse the repository at this point in the history
Release 0.6.14
  • Loading branch information
m-herold authored Jul 22, 2020
2 parents 1ba5e3b + 1ef36af commit f353304
Show file tree
Hide file tree
Showing 543 changed files with 52,192 additions and 4,434 deletions.
8 changes: 7 additions & 1 deletion Jenkinsfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ pipeline {
agent {
label 'MAC'
}

parameters {
gitParameter defaultValue: 'origin/master', name: 'gitBranch', type: 'BRANCH', description: 'Select the branch you want to build e.g. origin/master.'
password name: 'CI_PASSWORD', description: ''
password name: 'FASTLANE_SESSION', description: ''
password name: 'FIREBASE_API_KEY', description: ''
password name: 'FIREBASE_GOOGLE_APP_ID', description: ''
}
options {
timeout(time: 2, unit: 'HOURS')
timestamps()
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ For more information oriented towards developers please visit our [developers pa

# Issues #

For reporting issues use our [JIRA Bugtracking System](https://jira.catrob.at/secure/RapidBoard.jspa?rapidView=127). Before, please browse our currently open issues [here](https://jira.catrob.at/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+CATTY+AND+resolution+%3D+Unresolved+ORDER+BY+priority+DESC%2C+key+DESC&mode=hide).
For reporting issues use our [Jira issue tracker](https://jira.catrob.at/secure/CreateIssue.jspa?pid=11901&issuetype=1). Before creating a new bug, please browse our currently open issues [here](https://jira.catrob.at/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+CATTY+AND+resolution+%3D+Unresolved+ORDER+BY+priority+DESC%2C+key+DESC&mode=hide).

# Contributing #

If you want to contribute we suggest that you start with [forking](https://help.github.com/articles/fork-a-repo/) our repository and browse the code. Then you can look at our [Issue-Tracker](https://jira.catrob.at/secure/RapidBoard.jspa?rapidView=60) and start with fixing one ticket. We strictly use [Test-Driven Development](http://c2.com/cgi/wiki?TestDrivenDevelopment) and [Clean Code](http://www.planetgeek.ch/wp-content/uploads/2013/06/Clean-Code-V2.2.pdf), so first read everything you can about these development methods. Code developed in a different style will not be accepted.
After you've created a pull request we will review your code and do a full testrun on your branch.
We welcome all offers for help! If you want to contribute we suggest that you start with [forking](https://help.github.com/articles/fork-a-repo/) our repository and browse the code. You can then look at our [Jira issue tracker](https://jira.catrob.at/issues/?jql=project%20%3D%20Catty%20AND%20status%20%3D%20%22Ready%20For%20Development%22%20AND%20%22Experience%20Level%22%20in%20(BEGINNER%2CTRAINING)) and start working on a ticket. It is recommended to start your contribution on a ticket labelled as *TRAINING* or *BEGINNER* ticket. We strictly use [Test-Driven Development](http://c2.com/cgi/wiki?TestDrivenDevelopment) and [Clean Code](http://www.planetgeek.ch/wp-content/uploads/2013/06/Clean-Code-V2.2.pdf), code developed in a different style will not be accepted. After you have implemented a certain ticket, hand in a pull request on GitHub and have a look at our pull request template.

If you want to implement a new feature, please ask about the details on http://catrob.at/mailinglist or our [Google Group](https://groups.google.com/forum/#!forum/catty-ios)
If you want to implement a new feature, please ask about further details on [Google Groups](https://groups.google.com/forum/#!forum/catty-ios).

<!--
1. Make sure you have installed [Brew][1], a package manage for OSX, which the `bootstrap` script uses to pull dependencies
Expand Down
862 changes: 680 additions & 182 deletions src/Catty.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

150 changes: 150 additions & 0 deletions src/Catty/DataModel/Array/SynchronizedArray.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
/**
* Copyright (C) 2010-2020 The Catrobat Team
* (http://developer.catrobat.org/credits)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* An additional term exception under section 7 of the GNU Affero
* General Public License, version 3, is available at
* (http://developer.catrobat.org/license_additional_term)
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

public class SynchronizedArray<Element> {
private let queue = DispatchQueue(label: "SynchronizedArray", attributes: .concurrent)
private var array = [Element]()

var count: Int {
var result = 0
queue.sync { result = self.array.count }
return result
}

var isEmpty: Bool {
var result = false
queue.sync { result = self.array.isEmpty }
return result
}

var startIndex: Int {
var result = 0
queue.sync { result = self.array.startIndex }
return result
}

var first: Element? {
var result: Element?
queue.sync { result = self.array.first }
return result
}

var last: Element? {
var result: Element?
queue.sync { result = self.array.last }
return result
}

subscript(index: Int) -> Element? {
get {
var result: Element?
queue.sync {
guard self.array.startIndex..<self.array.endIndex ~= index else { return }
result = self.array[index]
}
return result
}
set {
guard let newValue = newValue else { return }
queue.async(flags: .barrier) {
self.array[index] = newValue
}
}
}

public func append(_ element: Element) {
queue.async(flags: .barrier) {
self.array.append(element)
}
}

public func remove(at index: Int) {
queue.async(flags: .barrier) {
self.array.remove(at: index)
}
}

public func insert(_ element: Element, at index: Int) {
queue.async(flags: .barrier) {
self.array.insert(element, at: index)
}
}

public func index( i: Int, offsetBy distance: Int) -> Int {
var result = 0
queue.sync {
result = self.array.index(i, offsetBy: distance)
}
return result
}

public func contains(where predicate: (Element) throws -> Bool) rethrows -> Bool {
var result = false
do {
try queue.sync {
do {
result = try self.array.contains(where: predicate)
} catch {
throw error
}
}
} catch {
throw error
}
return result
}

func isEqual(_ object: SynchronizedArray) -> Bool {
var result = true
queue.sync {
let count = self.array.count
if count == object.count {
for index in 0..<count where !Util.isEqual(self.array[index], to: object[index]) {
result = false
break
}
} else {
result = false
}
}
return result
}
}

public extension SynchronizedArray where Element: Equatable {
func contains(_ element: Element) -> Bool {
var result = false
queue.sync { result = self.array.contains(element) }
return result
}
}

extension SynchronizedArray where Element: UserDataProtocol {
func remove(name: String) {
queue.async(flags: .barrier) {
for index in 0..<self.array.count where name == self.array[index].name {
self.array.remove(at: index)
break
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ - (void)setFormula:(Formula*)formula forLineNumber:(NSInteger)lineNumber andPara

- (NSArray*)getFormulas
{
return @[self.pin,self.value];
return @[self.pin,self.value];
}

- (BOOL)allowsStringFormula
Expand Down
1 change: 0 additions & 1 deletion src/Catty/DataModel/Bricks/Brick.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#import "Brick.h"
#import "Script.h"
#import "BrickManager.h"
#import "NSString+CatrobatNSStringExtensions.h"
#import "IfLogicBeginBrick.h"
#import "LoopBeginBrick.h"
#import "BroadcastScript.h"
Expand Down
4 changes: 2 additions & 2 deletions src/Catty/DataModel/Bricks/Data/AddItemToUserListBrick.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
#import "BrickFormulaProtocol.h"
#import "BrickListProtocol.h"

@class UserVariable;
@class UserList;
@class Formula;

@interface AddItemToUserListBrick : Brick<BrickFormulaProtocol, BrickListProtocol>

@property (nonatomic, strong) UserVariable *userList;
@property (nonatomic, strong) UserList *userList;
@property (nonatomic, strong) Formula *listFormula;

@end
12 changes: 6 additions & 6 deletions src/Catty/DataModel/Bricks/Data/AddItemToUserListBrick.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

#import "Pocket_Code-Swift.h"
#import "AddItemToUserListBrick.h"
#import "Formula.h"
#import "UserVariable.h"
#import "Project.h"
#import "VariablesContainer.h"
#import "UserDataContainer.h"
#import "Script.h"

@implementation AddItemToUserListBrick
Expand All @@ -39,12 +39,12 @@ - (void)setFormula:(Formula*)formula forLineNumber:(NSInteger)lineNumber andPara
self.listFormula = formula;
}

- (UserVariable*)listForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber
- (UserList*)listForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber
{
return self.userList;
}

- (void)setList:(UserVariable*)list forLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber
- (void)setList:(UserList*)list forLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber
{
self.userList = list;
}
Expand All @@ -58,7 +58,7 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject
{
self.listFormula = [[Formula alloc] initWithInteger:1];
if(spriteObject) {
NSArray *lists = [spriteObject.project.variables allListsForObject:spriteObject];
NSArray *lists = [UserDataContainer objectAndProjectListsForObject:spriteObject];
if([lists count] > 0)
self.userList = [lists objectAtIndex:0];
else
Expand All @@ -84,7 +84,7 @@ - (NSString*)description

- (BOOL)isEqualToBrick:(Brick*)brick
{
if (! [self.userList isEqualToUserVariable:((AddItemToUserListBrick*)brick).userList])
if (! [self.userList isEqual:((AddItemToUserListBrick*)brick).userList])
return NO;
if (! [self.listFormula isEqualToFormula:((AddItemToUserListBrick*)brick).listFormula])
return NO;
Expand Down
5 changes: 3 additions & 2 deletions src/Catty/DataModel/Bricks/Data/ChangeVariableBrick.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

#import "Pocket_Code-Swift.h"
#import "ChangeVariableBrick.h"

@implementation ChangeVariableBrick
Expand Down Expand Up @@ -58,7 +59,7 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject
{
self.variableFormula = [[Formula alloc] initWithInteger:1];
if (spriteObject) {
NSArray *variables = [spriteObject.project.variables allVariablesForObject:spriteObject];
NSArray *variables = [UserDataContainer objectAndProjectVariablesForObject:spriteObject];
if([variables count] > 0) {
self.userVariable = [variables objectAtIndex:0];
} else {
Expand All @@ -80,7 +81,7 @@ - (NSString*)description

- (BOOL)isEqualToBrick:(Brick*)brick
{
if (![self.userVariable isEqualToUserVariable:((ChangeVariableBrick*)brick).userVariable]) {
if (![self.userVariable isEqual:((ChangeVariableBrick*)brick).userVariable]) {
return NO;
}
if (![self.variableFormula isEqualToFormula:((ChangeVariableBrick*)brick).variableFormula]) {
Expand Down
4 changes: 2 additions & 2 deletions src/Catty/DataModel/Bricks/Data/DeleteItemOfUserListBrick.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
#import "BrickFormulaProtocol.h"
#import "BrickListProtocol.h"

@class UserVariable;
@class UserList;
@class Formula;

@interface DeleteItemOfUserListBrick : Brick<BrickFormulaProtocol, BrickListProtocol>

@property (nonatomic, strong) UserVariable *userList;
@property (nonatomic, strong) UserList *userList;
@property (nonatomic, strong) Formula *listFormula;

@end
14 changes: 7 additions & 7 deletions src/Catty/DataModel/Bricks/Data/DeleteItemOfUserListBrick.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

#import "Pocket_Code-Swift.h"
#import "DeleteItemOfUserListBrick.h"
#import "Formula.h"
#import "UserVariable.h"
#import "Project.h"
#import "VariablesContainer.h"
#import "UserDataContainer.h"
#import "Script.h"

@implementation DeleteItemOfUserListBrick
Expand All @@ -44,26 +44,26 @@ - (void)setFormula:(Formula*)formula forLineNumber:(NSInteger)lineNumber andPara
self.listFormula = formula;
}

- (UserVariable*)listForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber
- (UserList*)listForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber
{
return self.userList;
}

- (void)setList:(UserVariable*)list forLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber
- (void)setList:(UserList*)list forLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber
{
self.userList = list;
}

- (NSArray*)getFormulas
{
return @[self.listFormula];
return @[self.listFormula];
}

- (void)setDefaultValuesForObject:(SpriteObject*)spriteObject
{
self.listFormula = [[Formula alloc] initWithInteger:1];
if(spriteObject) {
NSArray *lists = [spriteObject.project.variables allListsForObject:spriteObject];
NSArray *lists = [UserDataContainer objectAndProjectListsForObject:spriteObject];
if([lists count] > 0)
self.userList = [lists objectAtIndex:0];
else
Expand All @@ -84,7 +84,7 @@ - (NSString*)description

- (BOOL)isEqualToBrick:(Brick*)brick
{
if (! [self.userList isEqualToUserVariable:((DeleteItemOfUserListBrick*)brick).userList])
if (! [self.userList isEqual:((DeleteItemOfUserListBrick*)brick).userList])
return NO;
if (! [self.listFormula isEqualToFormula:((DeleteItemOfUserListBrick*)brick).listFormula])
return NO;
Expand Down
5 changes: 3 additions & 2 deletions src/Catty/DataModel/Bricks/Data/HideTextBrick.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

#import "Pocket_Code-Swift.h"
#import "HideTextBrick.h"
#import "Formula.h"

Expand All @@ -44,7 +45,7 @@ - (void)setVariable:(UserVariable*)variable forLineNumber:(NSInteger)lineNumber
- (void)setDefaultValuesForObject:(SpriteObject*)spriteObject
{
if(spriteObject) {
NSArray *variables = [spriteObject.project.variables allVariablesForObject:spriteObject];
NSArray *variables = [UserDataContainer objectAndProjectVariablesForObject:spriteObject];
if([variables count] > 0)
self.userVariable = [variables objectAtIndex:0];
else
Expand All @@ -60,7 +61,7 @@ - (NSString*)description

- (BOOL)isEqualToBrick:(Brick*)brick
{
if (! [self.userVariable isEqualToUserVariable:((HideTextBrick*)brick).userVariable])
if (! [self.userVariable isEqual:((HideTextBrick*)brick).userVariable])
return NO;
return YES;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Catty/DataModel/Bricks/Data/InsertItemIntoUserListBrick.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
#import "BrickFormulaProtocol.h"
#import "BrickListProtocol.h"

@class UserVariable;
@class UserList;
@class Formula;

@interface InsertItemIntoUserListBrick : Brick<BrickFormulaProtocol, BrickListProtocol>

@property (nonatomic, strong) UserVariable *userList;
@property (nonatomic, strong) UserList *userList;
@property (nonatomic, strong) Formula *elementFormula;
@property (nonatomic, strong) Formula *index;

Expand Down
Loading

0 comments on commit f353304

Please sign in to comment.