Skip to content

Commit

Permalink
Merge pull request #56 from Catrobat/develop
Browse files Browse the repository at this point in the history
Release v0.9
  • Loading branch information
rsamer authored Sep 15, 2017
2 parents dd85514 + ef09c83 commit 003d890
Show file tree
Hide file tree
Showing 154 changed files with 2,610 additions and 380 deletions.
28 changes: 14 additions & 14 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Licenses of the Catrobat system

The following licenses, terms, and conditions apply to your use of the Catrobat system:
The following licenses, terms, and conditions apply to your use of the Catrobat system:
Version 3.5, 28 January 2015
All source code of software constituting the Catrobat system, e.g., the integrated development environments (with all associated parts such as tutorial programs) and the interpreters and compilers for the Catrobat programming language, the image editing programs, the source code of software we wrote to run the Catrobat websites and other Internet resources, and all our own source code related to the Catrobat system, are free software: you can redistribute them and/or modify them 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 when it becomes available.

Expand All @@ -18,12 +18,12 @@ Catrobat additionally contains third party code and resources as follows:

libGDX: <http://libgdx.badlogicgames.com>
License information: Apache 2 License <https://raw.github.com/libgdx/libgdx/master/gdx/LICENSE>
Copyright 2011-2012 See <https://github.com/libgdx/libgdx/tree/master/gdx>
Copyright © 2011-2012 See <https://github.com/libgdx/libgdx/tree/master/gdx>

XStream: <http://xstream.codehaus.org>
License information: <http://xstream.codehaus.org/license.html>
Copyright 2003-2006, Joe Walnes
Copyright 2006-2009, 2011 XStream Committers
Copyright © 2003-2006, Joe Walnes
Copyright © 2006-2009, 2011 XStream Committers
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand All @@ -36,11 +36,11 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

Toolbar custom icons 1.0 facilities from Gentleface custom icon design: <http://gentleface.com/free_icon_set.html>
License information: Creative Commons Attribution-NonCommercial 3.0: <https://creativecommons.org/licenses/by-nc-nd/3.0/>
Copyright 2006-2011 Gentleface.
Copyright © 2006-2011 Gentleface.

MINDdroid: <https://github.com/NXT/LEGO-MINDSTORMS-MINDdroid>
Copyright 2010/11 Guenther Hoelzl, Shawn Brown
Copyright 2010/11 LEGO System A/S, Aastvej 1, DK-7190 Billund, Denmark
Copyright © 2010/11 Guenther Hoelzl, Shawn Brown
Copyright © 2010/11 LEGO System A/S, Aastvej 1, DK-7190 Billund, Denmark
MINDdroid is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
MINDdroid 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 General Public License for more details <http://www.gnu.org/licenses/>
Expand Down Expand Up @@ -104,21 +104,21 @@ Check back here from time-to-time, because we are always trying to improve our l
Please mail any suggestions regarding these licenses to [email protected].


Licenses of all used 3rd party libraries
Licenses of all used 3rd party libraries in ScratchToCatrobat

Libraries of our converter tool:
Batik 1.7 Apache License Version 2.0
jsoup under MIT license, Copyright 2009 - 2013 Jonathan Hedle([email protected])
jsoup under MIT license, Copyright © 2009 - 2016 Jonathan Hedley ([email protected])
xmlpull Initial authors: Stefan Haustein and Aleksander Slominski
xpp3_min Copyright 2002 Extreme! Lab, Indiana University. All rights reserved.
xstream Copyright by the BSD license

Web libraries:
bootstrap Copyright by the MIT license
jquery Copyright by the MIT license
qrcode Copyright by the MIT license
Web libraries:
bootstrap released under the MIT license and copyright 2017 Twitter
jquery released under the MIT license
qrcode released under the MIT license

Libraries used in Sourcecode filter:
Libraries used in Sourcecode filter:
Guava Apache License Version 2.0
SnakeYAML Licensed by APL 2.0.
Commons-io Apache License Version 2.0
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<img title="Scratch2Catrobat" src="https://cloud.githubusercontent.com/assets/3843968/9567706/5a084d76-4f35-11e5-9e3b-5a49256fde86.png" width=595 />

[![Version](https://img.shields.io/badge/version-0.8.1b-blue.svg)](https://img.shields.io/badge/version-0.8.1b-blue.svg)
[![Version](https://img.shields.io/badge/version-0.9.0b-blue.svg)](https://img.shields.io/badge/version-0.9.0b-blue.svg)

A tool for converting Scratch projects into Catrobat programs.

Expand All @@ -17,7 +17,7 @@ The Following License Header should be used for all python and java source files
## License Header for Python source files
<pre lang="python"><code>
# ScratchToCatrobat: A tool for converting Scratch projects into Catrobat programs.
# Copyright (C) 2013-2015 The Catrobat Team
# Copyright (C) 2013-2017 The Catrobat Team
# (http://developer.catrobat.org/credits)
#
# This program is free software: you can redistribute it and/or modify
Expand All @@ -42,7 +42,7 @@ The Following License Header should be used for all python and java source files
<pre lang="java"><code>
/*
* ScratchToCatrobat: A tool for converting Scratch projects into Catrobat programs.
* Copyright (C) 2013-2015 The Catrobat Team
* Copyright (C) 2013-2017 The Catrobat Team
* (http://developer.catrobat.org/credits)
*
* This program is free software: you can redistribute it and/or modify
Expand Down
8 changes: 4 additions & 4 deletions config/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
[APPLICATION]
name: Scratch2Catrobat Converter
short_name: S2CC
version: 0.8.1
version: 0.9.0
build_name: Aegean cat
build_number: 823-master
build_number: 911-develop

;-------------------------------------------------------------------------------
[CATROBAT]
; TODO: update this field manually every time the hierarchy changes
catrobat_language_version: 0.992
catrobat_language_version: 0.994
file_extension: .catrobat
automatic_screenshot_file_name: automatic_screenshot.png
media_license_url: http://developer.catrobat.org/ccbysa_v3 ; used for XML Header
Expand All @@ -23,7 +23,7 @@ repository_api_show_tags_url: https://api.github.com/repos/%(repository_owner

; TODO: update this field manually every time the hierarchy changes
; => should be updated automatically by SourceCodeFilter in future times
tag_name_of_used_hierarchy: v0.9.27
tag_name_of_used_hierarchy: v0.9.29

;-------------------------------------------------------------------------------
[SCRATCH]
Expand Down
Binary file added docs/GSoC2016Presentation_Final.pdf
Binary file not shown.
207 changes: 207 additions & 0 deletions docs/ManualFilterChanges.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
Issues:
--------------------------------------------------------------------------------
1) Folgende Zeile in org.catrobat.catroid.content.Look.java ersetzen:
public class Look extends Image {

mit:
public class Look {

--------------------------------------------------------------------------------
3) Folgende Zeile in org.catrobat.catroid.content.bricks.UserBrick.java (direkt in die Klasse) ersetzen:
try {
for (Formula formula : formulas) {
variables.add(new UserVariable(element.getText(), formula.interpretDouble(sprite)));
}
} catch (InterpretationException e) {
}

mit:
for (Formula formula : formulas) {
variables.add(new UserVariable(element.getText()));
}

--------------------------------------------------------------------------------
4) Folgende Zeilen in org.catrobat.catroid.io.BackwardCompatibleCatrobatLanguageXStream.java loeschen:

public void updateCollisionReceiverBrickMessage(File file) {
final String collisionTag = "CollisionScript";
final String receivedTag = "receivedMessage";
Document originalDocument = getDocument(file);

if (originalDocument != null) {
NodeList scripts = originalDocument.getElementsByTagName("script");
for (int i = 0; i < scripts.getLength(); i++) {
Node script = scripts.item(i);
NamedNodeMap attr = script.getAttributes();
if (attr.getLength() > 0) {
for (int j = 0; j < attr.getLength(); j++) {
if (attr.item(j).getNodeValue().equals(collisionTag)) {
NodeList messages = script.getChildNodes();
for (int k = 0; k < messages.getLength(); k++) {
Node message = messages.item(k);
if (message.getNodeName().equals(receivedTag)) {
String broadcastMessage = message.getTextContent();
String[] broadcastMessages = broadcastMessage.split("<(\\W)*-(\\W)*>");

if (broadcastMessages[1].matches("(\\W)*ANYTHING(\\W)*")) {
broadcastMessages[1] = PhysicsCollision.COLLISION_WITH_ANYTHING_IDENTIFIER;
}
broadcastMessage = broadcastMessages[0] + PhysicsCollision
.COLLISION_MESSAGE_CONNECTOR + broadcastMessages[1];

message.setTextContent(broadcastMessage);
}
}
}
}
}
}
}
saveDocument(originalDocument, file);
}

5) UNBEDINGT FOLGENDES KONTROLLIEREN:
CatroidFieldKeySorter.java oeffnen und alle equals()-Aufrufe in Methode sortProjectFields() anschauen.
JEDER (!) Equals-Vergleich MUSS in Project.java als Field/Membervariable vorkommen!!
zum Beispiel:
wenn fieldKey.getFieldName().equals("xmlHeader") in sortProjectFields() vorkommt, heißt das
dass es ein "xmlHeader"-Field/Membervariable in der Project-Klasse in Project.java geben MUSS!
Ist dies nicht der Fall mÃŒssen die Regeln in config.yml angepasst werden, sodass dieses Feld
nicht vom SourceCodeFilter weggefiltert wird.

6) UNBEDINGT FOLGENDES KONTROLLIEREN:
CatroidFieldKeySorter.java oeffnen und alle equals()-Aufrufe in Methode sortSpriteFields() anschauen.
JEDER (!) Equals-Vergleich MUSS in Sprite.java als Field/Membervariable vorkommen!!
zum Beispiel:
wenn fieldKey.getFieldName().equals("look") in sortProjectFields() vorkommt, heißt das
dass es ein "xmlHeader"-Field/Membervariable in der Sprite-Klasse in Sprite.java geben MUSS!
Ist dies nicht der Fall mÃŒssen die Regeln in config.yml angepasst werden, sodass dieses Feld
nicht vom SourceCodeFilter weggefiltert wird.


Zusatzregeln

-----------------------------------------------------------------------------------------------------------

In Look.java folgendes löschen:

boolean isBackgroundLook = getZIndex() == Constants.Z_INDEX_BACKGROUND;

-----------------------------------------------------------------------------------------------------------

In Project.java

Scene scene;
try {
scene = new Scene(context, context.getString(R.string.default_scene_name, 1), this);
} catch (Resources.NotFoundException e) {
//Because in test project we can't find the string
scene = new Scene(context, "Scene 1", this);
}

ersetzen durch

Scene scene = new Scene(null, "Scene 1", this);

-----------------------------------------------------------------------------------------------------------

In Project.java folgendes loeschen:
if (isCastProject) {
setChromecastFields();
}
// [...]
removeInvalidVariablesAndLists(oldProject.dataContainer);

-----------------------------------------------------------------------------------------------------------

In Project.java folgendes ändern:
public Project(Context context, String name, boolean landscapeMode, boolean isCastProject) {
zu:
public Project(Scene.Context context, String name, boolean landscapeMode, boolean isCastProject) {

und:
public Project(Context context, String name, boolean landscapeMode) {
zu:
public Project(Scene.Context context, String name, boolean landscapeMode) {

und:
public Project(Context context, String name) {
zu:
public Project(Scene.Context context, String name) {

und:
public Project(SupportProject oldProject, Context context) {
zu:
public Project(SupportProject oldProject, Scene.Context context) {

-----------------------------------------------------------------------------------------------------------

In Scene.java folgendes löschen:
import org.catrobat.catroid.content.bricks.BrickWithSpriteReference;

In Scene.java folgendes hinzufügen:

public class Context{};

-----------------------------------------------------------------------------------------------------------

In Scene.java folgendes einfügen:

background = new SingleSprite("Background");

und folgendes löschen:

background.look.setZIndex(0)

-----------------------------------------------------------------------------------------------------------

In UserScriptDefinitionBrick.java folgendes ersetzen:
@Override
public Script getScriptSafe() {
mit:
public Script getScriptSafe() {

-----------------------------------------------------------------------------------------------------------
In SpriteDataBehaviour folgende Methode löschen:
protected abstract boolean isClone(K key);

und:

Map<Sprite, List<V>> cloneForScene(Scene scene, Map<K, List<V>> dataMap) {
// [...]
}

und:

void removeCloneData() {
// [...]
}

-----------------------------------------------------------------------------------------------------------
In SpriteListBehaviour.java folgende Methode löschen:
protected boolean isClone(Sprite key) {
// [...]
}

-----------------------------------------------------------------------------------------------------------
In SpriteVariableBehaviour.java folgende Methode löschen:
@Override
Map<Sprite, List<UserVariable>> cloneForScene(Scene scene, Map<Sprite, List<UserVariable>> originalData) {
removeIllegalSpriteVariableEntries(null);
return super.cloneForScene(scene, originalData);
}

und:

@Override
protected boolean isClone(Sprite key) {
return key.isClone();
}

-----------------------------------------------------------------------------------------------------------
In UserBrickVariableBehaviour.java folgende Methode löschen:
@Override
protected boolean isClone(UserBrick key) {
return false;
}

Binary file modified docs/S2CC.pdf
Binary file not shown.
Binary file modified lib/catroid_class_hierarchy.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_dev_bu.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_v093.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_v095.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_v096.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_v097.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_v098.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_v099.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_v0991.jar
Binary file not shown.
Binary file removed lib/catroid_class_hierarchy_v0992_release.jar
Binary file not shown.
Binary file not shown.
Binary file modified resources/images/keys/computer_key_A.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_C.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_D.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_Down_Arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_E.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_F.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_G.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_H.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_I.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_J.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_K.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_L.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_Left_Arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_M.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_N.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_O.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_P.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_Q.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_R.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_Right_Arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_S.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_Space.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_T.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_U.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/keys/computer_key_Up_arrow.png
Binary file modified resources/images/keys/computer_key_V.png
Binary file modified resources/images/keys/computer_key_W.png
Binary file modified resources/images/keys/computer_key_X.png
Binary file modified resources/images/keys/computer_key_Y.png
Binary file modified resources/images/keys/computer_key_Z.png
Binary file modified resources/images/keys/computer_key_num_row_0.png
Binary file modified resources/images/keys/computer_key_num_row_1.png
Binary file modified resources/images/keys/computer_key_num_row_2.png
Binary file modified resources/images/keys/computer_key_num_row_3.png
Binary file modified resources/images/keys/computer_key_num_row_4.png
Binary file modified resources/images/keys/computer_key_num_row_5.png
Binary file modified resources/images/keys/computer_key_num_row_6.png
Binary file modified resources/images/keys/computer_key_num_row_7.png
Binary file modified resources/images/keys/computer_key_num_row_8.png
Binary file modified resources/images/keys/computer_key_num_row_9.png
2 changes: 1 addition & 1 deletion run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ScratchToCatrobat: A tool for converting Scratch projects into Catrobat programs.
# Copyright (C) 2013-2015 The Catrobat Team
# Copyright (C) 2013-2017 The Catrobat Team
# (<http://developer.catrobat.org/credits>)
#
# This program is free software: you can redistribute it and/or modify
Expand Down
11 changes: 6 additions & 5 deletions run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ScratchToCatrobat: A tool for converting Scratch projects into Catrobat programs.
# Copyright (C) 2013-2015 The Catrobat Team
# Copyright (C) 2013-2017 The Catrobat Team
# (<http://developer.catrobat.org/credits>)
#
# This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -52,14 +52,15 @@ for subdir, dirs, files in os.walk(helpers.SRC_PATH):
relative_subdir_path = relative_subdir_path[1:]
if relative_subdir_path.endswith(os.sep):
relative_subdir_path = relative_subdir_path[:-1]
test_module_name = relative_subdir_path.replace(os.sep, ".") + "." + file[:-3]
test_module_name = relative_subdir_path.replace(os.sep, ".") + "." + file
modules_under_test.add(test_module_name)

if len(sys.argv) >= 2 and sys.argv[1] != "all":
if (isinstance(sys.argv[1], str) or isinstance(sys.argv[1], unicode)) and sys.argv[1].startswith("test_"):
modules_under_test = filter(lambda m: sys.argv[1] in m, modules_under_test)
argument = sys.argv[1] if sys.argv[1].endswith('.py') else sys.argv[1] + ".py"
modules_under_test = filter(lambda m: m.endswith(argument), modules_under_test)
if len(modules_under_test) == 0:
helpers.error("Module %s not found" % sys.argv[1])
helpers.error("Module %s not found" % argument)
else:
helpers.error("Invalid input given! Module name must always start with 'test_' (e.g. 'test_scratch')")
else:
Expand All @@ -69,7 +70,7 @@ for module in modules_under_test:
print("-"*80)
print("Testing '%s':" % module)
print("-"*80)
exec_args = [jython_exec_path, "-m", module]
exec_args = [jython_exec_path, "-m", module[:-3]]

if len(sys.argv) >= 3:
exec_args += [sys.argv[2]]
Expand Down
Loading

0 comments on commit 003d890

Please sign in to comment.